#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k = 0;
  cin >> n;
  string a;
  cin >> a;
  for (long long i = 0; i < n - 1;)
    if ((a[i] == 'U' && a[i + 1] == 'R') || (a[i] == 'R' && a[i + 1] == 'U')) {
      i += 2;
      k++;
    } else
      i++;
  cout << n - k;
}
