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