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