#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, CW = 0, CB = 0;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      CW++;
    } else {
      CB++;
    }
  }
  if (CW >= CB) {
    cout << CB << endl;
  } else {
    cout << CW << endl;
  }
  return 0;
}
