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