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