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