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