#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int cnt = 0;
  char c[n];
  for (int i = 0; i < n; ++i) cin >> c[i];
  for (int i = 0; i < n - 1; ++i) {
    if (c[i] == c[i + 1]) ++cnt;
  }
  cout << cnt << endl;
  return 0;
}
