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