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