#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char** argv) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int c = 0;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == s[i + 1]) {
      c++;
    }
  }
  cout << c << endl;
}
