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