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