#include <bits/stdc++.h>
using namespace std;
int length(string str) {
  int ctr = 0;
  for (int x = 0; str[x] != '\0'; x++) {
    ctr++;
  }
  return ctr;
}
int replace(string str) {
  string ret;
  for (int x = 0; str[x] != '\0'; x++) {
    if ((str[x] == 'U' && str[x + 1] == 'R') ||
        (str[x] == 'R' && str[x + 1] == 'U')) {
      ret += 'D';
      x++;
    } else
      ret += str[x];
  }
  return length(ret);
}
int main() {
  int range;
  string str;
  cin >> range >> str;
  cout << replace(str);
  return 0;
}
