#include <bits/stdc++.h>
using namespace std;
long long n, m = 0, k, ans = 0, cap = 0;
vector<char> v;
int main() {
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++)
    if (v.size() && v.back() == s[i])
      ans++;
    else
      v.push_back(s[i]);
  cout << ans;
}
