#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int num = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#' && i + 1 < N) {
      if (S[i + 1] == '.') {
        num++;
        S[i + 1] = '#';
      }
    }
  }
  cout << num << endl;
  return 0;
}
