#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    char c;
    scanf(" %c", &c);
    if (s.empty())
      s += c;
    else if (s.back() != 'D' && s.back() != c)
      s.back() = 'D';
    else
      s += c;
  }
  cout << s.size() << endl;
  return 0;
}
