#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  string S;
  string K = "#";
  string T = ".";
  cin >> N >> S;
  int need = 0;
  int flagneed = 0;
  while (true) {
    for (int i = 0; i < N; i++) {
      if (S[i] == K[0]) {
        if (S[i + 1] == T[0]) {
          if (i > 0) {
            if (S[i - 1] == K[0]) {
              S.replace(i + 1, 1, "#");
              flagneed++;
            } else {
              S.replace(i, 1, ".");
              flagneed++;
            }
          } else {
            S.replace(i, 1, ".");
            flagneed++;
          }
        }
      }
    }
    if (flagneed > 0) {
      need += flagneed;
      flagneed = 0;
    } else {
      break;
    }
  }
  cout << need << endl;
  return 0;
}
