#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  vector<char> v;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] != s[i + 1]) {
      v.push_back(s[i]);
    }
  }
  cout << s.size() - v.size();
}
