#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, k;
  cin >> n;
  char a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  int r = 0, b = 0, g = 0;
  for (k = 0; k < n; k++) {
    if (a[k] == 'R' && a[k + 1] == 'R') {
      r++;
    } else if (a[k] == 'B' && a[k + 1] == 'B') {
      b++;
    } else if (a[k] == 'G' && a[k + 1] == 'G') {
      g++;
    }
  }
  cout << (r + b + g);
  return 0;
}
