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