#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = n;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == 'U' && s[i + 1] == 'R') {
      ans--;
      i++;
      continue;
    }
    if (s[i] == 'R' && s[i + 1] == 'U') {
      ans--;
      i++;
      continue;
    }
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tests = 1;
  while (tests--) {
    solve();
  }
}
