#include <bits/stdc++.h>
using namespace std;
int dy[5] = {0, 0, 1, -1, 0};
int dx[5] = {1, -1, 0, 0, 0};
int main(void) {
  int count = 0;
  int n;
  string s;
  cin >> n;
  cin >> s;
  for (int i = (0); i <= (n - 2); i++) {
    if (s[i] == '#') {
      if (s[i + 1] == '.') {
        count++;
      }
    }
  }
  cout << count << endl;
  return 0;
}
