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