#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[110], c;
  int len = 0, n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> c;
    s[len++] = c;
    if (len > 1 && s[len - 2] != s[len - 1] && s[len - 2] != 'D') {
      len -= 2;
      s[len++] = 'D';
    }
  }
  s[len++] = '\0';
  cout << strlen(s) << endl;
  return 0;
}
