#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  int count = 0;
  int buff = 0;
  char less, most;
  string s;
  bool all = true;
  cin >> n >> s;
  int scount = 0;
  int pcount = 0;
  for (int j = 0; j < s.size(); ++j) {
    if (s[j] == '#') {
      scount++;
    } else {
      pcount++;
    }
  }
  if (scount > pcount) {
    cout << pcount;
  } else {
    cout << scount;
  }
  return 0;
}
