#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int N;
  string S;
  cin >> N;
  cin >> S;
  const char *c = S.c_str();
  int cnt = 0;
  for (int i = 0; i < N - 1; i++) {
    if (c[i] == '#' and c[i + 1] == '.') {
      cnt++;
    }
  }
  cout << cnt << endl;
}
