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