#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ans = 0;
  char prev;
  while (n--) {
    char c;
    cin >> c;
    if (c == prev) ans++;
    prev = c;
  }
  cout << ans;
}
