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