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