#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[1001];
  int n;
  cin >> n;
  int count = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    count++;
    if (a[i] == 'R' && a[i + 1] == 'U')
      i++;
    else if (a[i] == 'U' && a[i + 1] == 'R')
      i++;
  }
  cout << count;
}
