#include <bits/stdc++.h>
using namespace std;
void fileio() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 1; i < n; ++i) {
    if (s[i] == s[i - 1]) ++ans;
  }
  cout << ans << endl;
  return 0;
}
