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