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