#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int pair = 0;
  cin >> n;
  string str;
  cin >> str;
  for (int i = 0; i < str.length(); i++) {
    if (str[i] == str[i + 1]) pair++;
  }
  cout << pair << endl;
  return 0;
}
