#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  int num = 0;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (i + 1 < n and s[i] == '#' and s[i + 1] == '.') {
      num++;
    }
  }
  cout << num << endl;
}
