#include <bits/stdc++.h>
int main(void) {
  int cnt = 0;
  int i = 0;
  int len = 0;
  char moji[200000];
  char moji2[2000000];
  char moji3[2000000];
  char num = 0;
  scanf("%s", moji);
  len = strlen(moji);
  moji2[i] = moji[i];
  cnt++;
  num++;
  do {
    moji3[0] = moji[i + 1];
    if (strcmp(moji2, moji3) != 0) {
      cnt++;
      num++;
      moji2[0] = '\0';
      moji2[0] = moji3[0];
      i++;
      moji3[0] = '\0';
    } else {
      moji3[1] = moji[i + 2];
      if (strcmp(moji2, moji3) != 0) {
        cnt++;
        num += 2;
        moji2[0] = '\0';
        moji2[0] = moji3[0];
        moji2[1] = moji3[1];
        i += 2;
        moji3[0] = '\0';
      }
    }
    if (moji3[1] != '\0') {
      moji3[2] = moji[i + 3];
      if (strcmp(moji2, moji3) != 0) {
        cnt++;
        num += 3;
        moji2[0] = '\0';
        moji2[0] = moji3[0];
        moji2[1] = moji3[1];
        moji2[2] = moji3[2];
        i += 3;
        moji3[0] = '\0';
      }
    }
  } while (num != len);
  printf("%d", cnt);
  return 0;
}
