#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N;
  string S;
  cin >> N >> S;
  long long int ans = 0;
  for (long long int i = 0; i < N - 1; ++i) {
    if (S[i] == S[i + 1])
      continue;
    else {
      ++ans;
      ++i;
    }
  }
  cout << ans << endl;
}
