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