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