#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  string ss = s, sss;
  for (int i = 0; i < 10000; ++i) {
    sss = "";
    for (int j = 0; j < n;) {
      if (ss[j] == 'R' && ss[j + 1] == 'U') {
        sss += 'D';
        j += 2;
      } else if (ss[j + 1] == 'R' && ss[j] == 'U') {
        sss += 'D';
        j += 2;
      } else {
        sss += ss[j];
        j++;
      }
    }
    ss = sss;
  }
  int ans = 0;
  for (int i = 0; i < ss.size(); ++i)
    if (ss[i] == 'R' || ss[i] == 'U' || ss[i] == 'D')
      ans++;
    else
      break;
  cout << ans;
}
