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