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