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