#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  cin >> n;
  string s;
  cin >> s;
  long c = 0;
  for (long i = 1; i < n; i++) {
    if (s[i] == s[i - 1]) {
      c++;
    }
  }
  cout << c << endl;
}
