#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int count = 0;
  int f;
  for (int i = 0; i < s.length();) {
    char x = s[i];
    int p = i;
    f = 0;
    for (int j = p + 1; j < s.length(); j++) {
      if (x != s[j]) {
        break;
      }
      f++;
      count++;
    }
    if (f > 0) {
      i += f;
    } else {
      i++;
    }
  }
  cout << count;
}
