#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &out, vector<T> &v) {
  for (T i : v) out << i << (next(&i) != v.end()) ?: " ";
  return out;
}
template <typename T>
istream &operator>>(istream &in, vector<T> &v) {
  for (T &i : v) in >> i;
  return in;
}
void task();
int32_t main() {
  long long t = 1;
  while (t--) task();
  return 0;
}
void task() {
  long long n;
  cin >> n;
  string str;
  cin >> str;
  long long ans = 0;
  for (long long i = 1; i < n; i++) {
    if (str[i] == str[i - 1]) {
      ans++;
    }
  }
  cout << ans << endl;
}
