#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char kata, past;
  scanf("%d", &n);
  getchar();
  scanf("%c", &kata);
  past = kata;
  n--;
  int h = 0;
  while (n--) {
    scanf("%c", &kata);
    if (kata == past) {
      h++;
    } else {
      past = kata;
    }
  }
  printf("%d\n", h);
}
