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