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