#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
  cin >> n >> s;
  int i = 1;
  while (i < s.length()) {
    if (s[i] != s[i - 1]) {
      n--;
      i += 2;
    } else
      i++;
  }
  cout << n;
}
