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