#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, r = 0;
  cin >> n;
  string a;
  cin >> a;
  if (n == 1)
    r = 1;
  else {
    for (int i = 0; i < n - 1;) {
      if (a[i] != a[i + 1]) {
        r++;
        i += 2;
        if (i == n - 1) r++;
      } else if (i == (n - 2)) {
        r += 2;
        i++;
      } else {
        r++;
        i++;
      }
    }
  }
  cout << r;
  return 0;
}
