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