#include <bits/stdc++.h>
void solve(char *);
int main() {
  int n;
  scanf("%d", &n);
  char inp[n + 1];
  scanf("%s", inp);
  solve(inp);
  return 0;
}
void solve(char *inp) {
  int ans = 0;
  if (!inp || inp[0] == '\0') return;
  char last = ' ';
  int i = 0;
  while (inp[i] != '\0') {
    if (inp[i] == last)
      ans++;
    else
      last = inp[i];
    i++;
  }
  printf("%d", ans);
}
