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