#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c = 1;
  bool prev = false;
  string s;
  cin >> n >> s;
  for (int i = 1; i < s.length(); i++)
    if (!(!prev && ((s[i] == 'R' && s[i - 1] == 'U') ||
                    (s[i] == 'U' && s[i - 1] == 'R')))) {
      c++;
      prev = false;
    } else {
      prev = true;
    }
  cout << (n > 0 ? c : 0);
  return 0;
}
