#include <bits/stdc++.h>
int main(void) {
  char str[200000 + 1];
  char buf1;
  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 = str[0];
  i = 1;
  count++;
  while (i < len) {
    if (buf1 != str[i]) {
      count++;
      buf1 = str[i];
      i++;
    } else if (i + 3 < len) {
      count += 2;
      buf1 = str[i + 2];
      i += 3;
    } else {
      break;
    }
  }
  printf("%lld\n", count);
  return 0;
}
