#include <bits/stdc++.h>
using namespace std;
int main() {
  string c;
  int counter = 0;
  int n;
  cin >> n;
  cin >> c;
  for (int i = 0; i < n - 1; i++) {
    if (c.at(i) == c.at(i + 1)) counter += 1;
  }
  cout << counter;
}
