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