#include <bits/stdc++.h>
int main() {
  int n;
  std::string s;
  std::cin >> n >> s;
  std::string rs = s;
  char ans[n];
  int counter = 0;
  for (int ii = 0; ii < n - 1; ++ii) {
    if (ii <= n - 3) {
      if (rs[ii] == '#' && rs[ii + 1] == '.' && rs[ii + 2] == '.') {
        rs[ii] = '.';
        counter++;
      } else if (rs[ii] == '#' && rs[ii + 1] == '.' && rs[ii + 2] == '#') {
        rs[ii + 1] = '#';
        counter++;
      }
    }
    if (ii == n - 2) {
      if (rs[ii] == '#' && rs[ii + 1] == '.') {
        rs[ii + 1] = '#';
        counter++;
      }
    }
  }
  std::cout << counter;
}
