#include <bits/stdc++.h>
int main(void) {
  int i = 0, j = 0;
  int counter = 0;
  int double_jump = 0;
  char bs[2 * 10 ^ 5];
  scanf("%s", bs);
  while (bs[i] != '\0') {
    i++;
  }
  while (j < i) {
    if (double_jump == 1) {
      counter++;
      j++;
      double_jump = 0;
    } else if (bs[j] != bs[j + 1]) {
      counter++;
      j++;
    } else {
      counter++;
      j = j + 2;
      double_jump = 1;
    }
  }
  printf("%d", counter);
  return 0;
}
