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