#include <bits/stdc++.h>
int main() {
  char S[10001];
  scanf("%s\n", S);
  S[strlen(S)] = '\0';
  char prev[10001];
  int cnt = 0;
  for (int i = 0; i < strlen(S); i++) {
    cnt++;
    prev[0] = S[i];
    if (strlen(prev) > 1 || S[i] != prev[0])
      prev[1] = '\0';
    else if (i != strlen(S) - 1) {
      prev[1] = S[++i];
      prev[2] = '\0';
    }
  }
  printf("%d\n", cnt);
  return (0);
}
