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