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