#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<char> v;
  char a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    v.insert(v.end(), a);
  }
  a = v[0];
  int counter = 0;
  for (int i = 1; i < n; i++) {
    if (v[i] == a) {
      counter++;
    }
    a = v[i];
  }
  cout << counter;
  return 0;
}
