#include <bits/stdc++.h>
int main() {
  int n, count = 0;
  scanf("%d", &n);
  char stones[n + 1];
  scanf("%s", stones);
  for (int i = 0; i < n - 1; i++) {
    if (stones[i] == stones[i + 1]) count++;
  }
  printf("%d\n", count);
  return 0;
}
