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