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