#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long N;
  string S, mirra;
  cin >> N >> S;
  mirra = S;
  long long count = 0;
  for (long long i = 0; i < mirra.size(); i++) {
    mirra[i] = '#';
  }
  for (long long i = 0; i < S.size(); i++) {
    if (mirra[i] != S[i]) {
      count++;
    }
  }
  if (S[0] == '.' && S[1] == '.' && S[2] == '#' && S.size() >= 2) {
    count--;
  }
  if (count == N) {
    cout << 0 << endl;
    return 0;
  }
  cout << min(N - count, count) << endl;
  return 0;
}
