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