#include <bits/stdc++.h>
int main(void) {
  int n, i, j, add = 0, count = 0;
  scanf("%d", &n);
  char *a = (char *)malloc(sizeof(char) * 2 * n);
  char c;
  scanf("%s", a);
  c = a[0];
  for (i = 1; a[i] != '\0'; i++) {
    if (a[i] == c)
      add++;
    else
      c = a[i];
  }
  printf("%d", add);
  return 0;
}
