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