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