#include <bits/stdc++.h>
int main(void) {
  char str[200000 + 1];
  char buf1[200000 + 1];
  int i;
  int sublen = 1;
  int len;
  int buflen;
  int j, flag;
  long long int count = 0;
  scanf("%s", str);
  i = 0;
  while (str[i++] != '\0')
    ;
  len = i - 1;
  buf1[0] = str[0];
  count++;
  i = 1;
  buflen = 1;
  while (i + sublen - 1 < len) {
    j = 0;
    while (j < buflen && buf1[j] == str[i + j]) {
      j++;
    }
    if (j == sublen) {
      sublen++;
    } else {
      count++;
      buflen = sublen;
      for (j = 0; j < sublen; j++) {
        buf1[j] = str[i + j];
      }
      i = i + sublen;
      sublen = 1;
    }
  }
  printf("%lld\n", count);
  return 0;
}
