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