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