#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  char prev = s[0];
  int ans = 0;
  for (int i = 1; i < n; ++i) {
    if (prev == s[i]) {
      ans += 1;
    }
    prev = s[i];
  }
  cout << ans << endl;
  return 0;
}
