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