#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const int MAXN = 1000100;
char s[110];
int main() {
  int n;
  cin >> n;
  char c;
  int r = 0, u = 0;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
  }
  int ans = n;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'U' && s[i + 1] == 'R' || s[i] == 'R' && s[i + 1] == 'U') {
      --ans;
      i++;
    }
  }
  cout << ans << endl;
  return 0;
}
