#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y;
  cin >> x;
  y = x;
  char c = '0', lc;
  for (int i = 0; i < x; i++) {
    lc = c;
    cin >> c;
    if ((lc != '0') && (lc != c)) {
      y--;
      c = '0';
    }
  }
  cout << y << "\n";
  return 0;
}
