#include <bits/stdc++.h>
using namespace std;
int main() {
  string z, x, y;
  int ans = 0, a;
  cin >> a;
  cin >> x;
  y = "UR";
  z = "RU";
  for (int i = 0; i < x.size(); i++) {
    if ((x[i] == 'R' && x[i + 1] == 'U') || (x[i] == 'U' && x[i + 1] == 'R')) {
      ans++;
      i++;
    }
  }
  cout << a - ans;
}
