#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int sum = 0;
  cin >> n;
  vector<char> s(n);
  for (int j = 0; j < n; j++) cin >> s[j];
  for (int i = 0; i < n - 1; i++) {
    if (s[i] = '#') {
      if (s[i + 1] == '.') {
        sum++;
      }
    }
  }
  cout << sum << endl;
  return 0;
}
