#include <bits/stdc++.h>
using namespace std;
template <typename T = int>
T in() {
  T temp;
  cin >> temp;
  return temp;
}
template <typename VType = int>
list<VType> const LR(VType start, VType end) {
  list<VType> ret;
  for (VType i = start; i < end; i++) ret.push_back(i);
  return move(ret);
}
int main() {
  int N(in());
  auto S(in<string>());
  int count = 0;
  bool cont = false;
  for (int i = 1; i < N; i++) {
    if (S[i - 1] != S[i]) {
      if ((N - 1) == i || S[i] != S[i + 1]) {
        S[i] = S[i - 1];
        count++;
      } else if (1 < i && S[i - 2] == S[i - 1]) {
        S[i] = S[i - 1];
        count++;
      }
    }
  }
  cout << count << endl;
  return 0;
}
