#include <bits/stdc++.h>
using namespace std;
int main() {
  int len;
  char str[105];
  while (~scanf("%d", &len)) {
    scanf("%s", str);
    int ans = 0;
    for (int i = 0; i < len; i++) {
      if ((str[i] == 'R' && str[i + 1] == 'U') ||
          (str[i] == 'U' && str[i + 1] == 'R')) {
        ans++;
        i++;
      }
    }
    printf("%d\n", len - ans);
  }
}
