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