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