#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  unsigned char c[N - 1];
  cin >> N;
  cin >> c;
  int w = 0;
  int b = 0;
  char wb[] = ".#";
  for (int i = 0; i < N; i++) {
    if (c[i] == wb[0]) {
    } else {
      w++;
    }
  }
  for (int i = 0; i < N; i++) {
    if (c[i] == wb[1]) {
    } else {
      b++;
    }
  }
  cout << min(b, w) << endl;
  return 0;
}
