#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  int n;
  cin >> n >> s;
  int res = 0;
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    if (i < n - 1 &&
        ((s[i] == 'R' && s[i + 1] == 'U') || (s[i] == 'U' && s[i + 1] == 'R')))
      i++;
    res++;
  }
  cout << res << endl;
  return 0;
}
