#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < s.size(); ++i) {
    int act = 1;
    while (i < s.size() - 1 && s[i] == s[i + 1]) ++i, ++act;
    ans += (act - 1);
  }
  cout << ans << '\n';
  return 0;
}
