#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  int ans = 0, N, B = 0, W = 0;
  bool wit = true;
  cin >> N;
  cin >> S;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == '#') {
      B++;
    } else {
      W++;
    }
  }
  cout << min(B, W) << endl;
}
