#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char str[101];
  cin >> str;
  int len = strlen(str);
  int i, c = 0;
  for (i = 0; i < len - 1;) {
    if ((str[i] == 'U' and str[i + 1] == 'R') or
        (str[i] == 'R' and str[i + 1] == 'U')) {
      c++;
      i += 2;
    } else
      i++;
  }
  cout << n - c;
}
