#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int cnt = 0;
  bool prevBlack = false;
  for (int i = 0; i < N; i++) {
    char c = S.at(i);
    if (c == '.') {
      if (prevBlack) {
        cnt++;
      }
      prevBlack = false;
    } else if (c == '#') {
      prevBlack = true;
    }
  }
  cout << cnt << endl;
}
