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