#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  cin.ignore();
  string s;
  cin >> s;
  int ans = 0;
  char last = 'A';
  for (int i = 0; i < n; i++) {
    if (s[i] != last) {
      last = s[i];
    } else {
      ans++;
    }
  }
  cout << ans;
  return 0;
}
