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