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