#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  int N, cntw = 0, cntb = 0;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      cntb++;
    }
    if (S[i] == '.') {
      cntw++;
    }
  }
  cout << min(cntb, cntw);
}
