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