#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char s[11000];
  cin >> n;
  cin >> s;
  int i = 0, count = 0;
  while (i < n) {
    if ((s[i] == 'U' && s[i + 1] == 'R') || (s[i] == 'R' && s[i + 1] == 'U')) {
      i = i + 2;
      count++;
    } else {
      i = i + 1;
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
