#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s, g = "";
  cin >> s;
  for (int i = 0; i < n; i++) {
    if ((s[i] == 'U' && s[i + 1] == 'R') || (s[i + 1] == 'U' && s[i] == 'R')) {
      g += 'D';
      i++;
    } else
      g += s[i];
  }
  cout << g.length();
  return 0;
}
