#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, j;
  string s;
  long long res = 0, k = 0, ress = 0;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      if (s[i + 1] == '.' && s[i + 2] == '.') {
        s[i] = '.';
        res++;
      } else
        k = 1;
    }
    if (k == 1) break;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      j = i;
      ress++;
      break;
    }
  }
  if (ress == 1) {
    for (int i = j + 1; i < n; i++) {
      if (s[i] == '.') res++;
    }
    cout << res << endl;
  } else if (ress == 0)
    cout << '0' << endl;
}
