#include <bits/stdc++.h>
using namespace std;
int main() {
  char c, s;
  int i, k = 0, n;
  cin >> n;
  cin >> c;
  s = c;
  for (i = 1; i < n; i++) {
    cin >> c;
    if (c == s) k++;
    s = c;
  }
  cout << k;
  return 0;
}
