#include <bits/stdc++.h>
using namespace std;
int main() {
  stack<char> s;
  int n, count = 0;
  char c;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> c;
    if (s.empty())
      s.push(c);
    else if (s.top() == c) {
      s.pop();
      s.push(c);
      count++;
    } else
      s.push(c);
  }
  cout << count << endl;
  return 0;
}
