#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  int no = 0;
  queue<char> Q;
  cin >> s;
  for (int i = 0; i < n; i++) {
    Q.push(s[i]);
  }
  while (Q.empty() == 0) {
    char temp;
    temp = Q.front();
    Q.pop();
    if (temp == Q.front()) {
      no++;
    }
  }
  cout << no << endl;
}
