#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string s;
  cin >> N >> s;
  if (s.length() == 1) {
    cout << "0" << endl;
    return 0;
  }
  int ans = 0;
  for (int i = 0; i < s.length() - 1; i++) {
    char niko = s[i];
    char ikko = s[i + 1];
    if (niko == ikko) {
      s[i + 1] = (s[i + 1] == '.' ? '#' : '.');
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
