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