#include <bits/stdc++.h>
using namespace std;
int main() {
  int i = 0, n = 0, count = 0, l = 0;
  string A;
  cin >> l >> A;
  n = A.length();
  for (; i < n - 1; i++) {
    if (A[i] == A[i + 1]) {
      A.erase(A.begin() + i + 1);
      i--;
      count++;
    }
    n = A.length();
  }
  cout << count;
  return 0;
}
