#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const double pi = acos(-1.0);
const int N = 1e5 + 10;
const int mod = 100;
int main() {
  string str;
  int n, ans;
  cin >> n >> str;
  ans = n;
  for (int i = 0; i < n - 1; i++) {
    if (str[i] == 'U' && str[i + 1] == 'R') {
      ans--;
      i++;
    } else if (str[i] == 'R' && str[i + 1] == 'U') {
      i++;
      ans--;
    }
  }
  cout << ans << endl;
  return 0;
}
