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