#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int bc = 0, wc = 0;
  for (auto e : s) {
    if (e == '#')
      ++bc;
    else
      ++wc;
  }
  cout << min(bc, wc) << endl;
  return 0;
}
