#include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
  int i, ans = 0;
  char S[200001] = "", Si[200001] = "", buf1[200001] = "", buf2[200001] = "";
  scanf("%s", S);
  for (i = 0; i < strlen(S); i++) {
    strcpy(buf2, buf1);
    sprintf(Si, "%c", S[i]);
    if (strcmp(buf1, Si) == 0) {
      sprintf(Si, "%c%c", S[i], S[i + 1]);
      i++;
    }
    strcpy(buf1, Si);
    ans++;
  }
  if (strcmp(buf1, buf2) == 0) ans--;
  printf("%d", ans);
  return 0;
}
