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