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