#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string stones;
  int ans = 0;
  cin >> n;
  cin >> stones;
  for (int i = 0; i < n - 1; i++)
    if (stones[i] == stones[i + 1]) ans++;
  cout << ans << endl;
  return 0;
}
