#include <bits/stdc++.h>
char S[200000];
int slen;
int eqs(int start, int end) {
  int i;
  int d = start - end + 1;
  for (i = start; i <= end; i++) {
    if (S[i] != S[i + d]) return 0;
  }
  return 1;
}
int main(int argc, char *argv[]) {
  int sr;
  int a, b;
  int i, j;
  int dn, dmax = 1;
  int start, end;
  sr = scanf("%s", S);
  slen = strlen(S);
  dn = 1;
  for (i = 0; i < slen - 1; i++) {
    if (S[i] == S[i + 1]) i++;
    dn++;
  }
  printf("%d\n", dn);
  fflush(stdout);
  return 0;
}
