#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  if (n == 1) {
    cout << "1" << endl;
    exit(0);
  }
  for (int i = 0; i < n - 1; i++) {
    string ss = s.substr(i, 2);
    if (ss == "RU" || ss == "UR") {
      s[i] = '*';
      s[i + 1] = '_';
    }
  }
  int answ = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'R' || s[i] == 'U' || s[i] == '*') answ++;
  }
  cout << answ << endl;
  return 0;
}
