#include <bits/stdc++.h>
int main() {
  char S[200003];
  scanf("%s", &S);
  int i, count = 0;
  for (i = 1; S[i] != 0; i++) {
    if (S[i] == S[i - 1]) {
      count++;
      if (S[i + 2] != 0)
        i += 2;
      else if (S[i + 1] != 0)
        i++;
    }
  }
  printf("%d\n", i - count);
  fflush(stdout);
  return 0;
}
