#include <bits/stdc++.h>
using namespace std;
int main() {
  int N = 0;
  string S;
  cin >> N;
  cin >> S;
  bool last, now;
  last = 0;
  now = 0;
  int count = 0;
  for (int i = 0; i < S.size(); i++) {
    now = S[i] == '#';
    if (last & !now) {
      count++;
    }
    last = now;
  }
  cout << count << endl;
}
