#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int dp[111];
int main() {
  cin >> n;
  cin >> s;
  dp[0] = 1;
  for (int i = 1; i < n; i++) {
    if (s[i] == 'R' && s[i - 1] == 'U')
      dp[i] = (i > 1 ? dp[i - 2] : 0) + 1;
    else if (s[i] == 'U' && s[i - 1] == 'R')
      dp[i] = (i > 1 ? dp[i - 2] : 0) + 1;
    else
      dp[i] = dp[i - 1] + 1;
  }
  cout << dp[n - 1] << endl;
}
