#include <bits/stdc++.h>
int len, ans;
char S[100100];
int main() {
  scanf("%s", S + 1);
  len = strlen(S + 1);
  int now = 1;
  while (now <= len) {
    ans++, now++;
    while (S[now] != S[now - 1] && now <= len) ans++, now++;
    if (now >= len) break;
    ans++, now += 2;
  }
  printf("%d\n", ans);
}
