#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] == '#')
      cb++;
    else
      cw++;
  }
  cout << min(cb, cw) << endl;
  return 0;
}
