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