#include <bits/stdc++.h>
using namespace std;
bool helper(vector<char> v) {
  for (int i = 0; i < v.size() - 1; i++) {
    if (v[i] == v[i + 1]) return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<char> v, temp;
  string str;
  cin >> str;
  for (int i = 0; i < n; i++) v.push_back(str[i]);
  while (helper(v)) {
    temp.push_back(v[0]);
    int j = 1;
    for (int i = 0; j < v.size(); i++, j++) {
      if (v[j] != v[i]) {
        temp.push_back(v[j]);
      }
    }
    v.clear();
    v = temp;
    temp.clear();
  }
  int ans = 0;
  for (int i = 0; i < v.size(); i++)
    if (v[i] == 'B' or v[i] == 'G' or v[i] == 'R') ans++;
  cout << n - ans;
  return 0;
}
