#include <bits/stdc++.h>
using namespace std;
int n, i, ans = 200010;
int black_left[200010];
int white_right[200010];
char stone[200010];
int main() {
  cin >> n;
  scanf("%s", stone);
  if (stone[0] == '#')
    black_left[0] = 1;
  else
    black_left[0] = 0;
  if (stone[n - 1] == '.')
    white_right[n - 1] = 1;
  else
    white_right[n - 1] = 0;
  for (i = 1; i <= n - 1; i++) {
    if (stone[i] == '#')
      black_left[i] = black_left[i - 1] + 1;
    else
      black_left[i] = black_left[i - 1];
  }
  for (i = n - 2; i >= 0; i--) {
    if (stone[i] == '.')
      white_right[i] = white_right[i + 1] + 1;
    else
      white_right[i] = white_right[i + 1];
  }
  ans = min(white_right[0], black_left[0]);
  for (i = 0; i <= n - 1; i++)
    ans = min(ans, black_left[i] + white_right[i + 1]);
  cout << ans;
  return 0;
}
