#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<char> a;
  char x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    a.push_back(x);
  }
  for (int i = 0; i < a.size(); i++) {
    if (a[i] == 'U' && a[i + 1] == 'R') {
      a.erase(a.begin() + i);
      a[i] = 'D';
    }
    if (a[i] == 'R' && a[i + 1] == 'U') {
      {
        a.erase(a.begin() + i);
        a[i] = 'D';
      }
    }
  }
  cout << a.size();
  return 0;
}
