#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  int ans = 0, N, B = 0, W = 0, sumB = 0;
  bool wit = true;
  cin >> N;
  cin >> S;
  if (S[0] == '#') {
    wit = false;
  }
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == '#') {
      if (wit) {
        ans += B;
        B = 0;
        W = 0;
      }
      wit = false;
      B++;
      sumB++;
    } else {
      wit = true;
      W++;
    }
  }
  if (wit) {
    ans += B;
  }
  cout << min(ans, min(N - sumB, sumB)) << endl;
}
