#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, i;
  cin >> n;
  string second;
  cin >> second;
  char neighbour = second[0];
  long long count = 0;
  for (i = 1; i < n; i++) {
    if (second[i] == neighbour)
      count++;
    else
      neighbour = second[i];
  }
  cout << count << "\n";
  return 0;
}
