#include <bits/stdc++.h>
using namespace std;
int n, i, rez;
char S[105];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  cin >> (S + 1);
  rez = n;
  for (i = 1; i < n; i++) {
    if (S[i] != S[i + 1] && S[i] != 'D') {
      rez--;
      S[i + 1] = 'D';
    }
  }
  cout << rez << "\n";
  return 0;
}
