#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, c = 0;
  string s;
  cin >> n >> s;
  for (i = 0; i < n - 1; i++) {
    if (s[i] == 'R' && s[i + 1] == 'U' || s[i] == 'U' && s[i + 1] == 'R') {
      c++;
      i++;
    }
  }
  cout << n - c;
  return 0;
}
