#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  string S;
  cin >> N >> S;
  long long cnt = 0;
  int b = 0;
  int w = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      b++;
    } else {
      w++;
    }
  }
  if (b > w) {
    if (b != N) {
      cout << w << endl;
    } else {
      cout << 0 << endl;
    }
  } else {
    if (w != N) {
      cout << b << endl;
    } else {
      cout << 0 << endl;
    }
  }
}
