#include <bits/stdc++.h>
int main() {
  int i, c = 0;
  char b, s[100010];
  scanf("%s", s);
  b = 0;
  for (i = 0; s[i]; i++) {
    if (s[i] == b) {
      i++;
      c++;
      b = 0;
    } else {
      c++;
      b = s[i];
    }
  }
  if (s[i - 1] == 0) c--;
  printf("%d\n", c);
  return 0;
}
