#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt_black = 0, cnt_white = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '#')
      cnt_black++;
    else
      cnt_white++;
  }
  cout << min(cnt_black, cnt_white) << endl;
  return 0;
}
