#include <bits/stdc++.h>
int main(void) {
  int len, i = 1, ans[2];
  int a[200005], b[200005];
  char s[200005];
  gets(s);
  len = strlen(s);
  for (int k = 1; k <= 2; k++) {
    ans[k] = 1;
    a[k] = k;
    while (len - 1 != i) {
      if (a[i - 1] == 1) {
        if (s[i - 1] == s[i]) {
          a[i + 1] = 2;
          i++;
        } else {
          a[i] = 1;
        }
      } else {
        a[i] = 1;
      }
      ans[k]++;
      i++;
    }
    i = 1;
  }
  if (ans[1] <= ans[2]) {
    ans[0] = ans[2];
  } else {
    ans[0] = ans[1];
  }
  printf("%d", ans[0]);
  return 0;
}
