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