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