#include <bits/stdc++.h>
char s[205050];
int main() {
  scanf("%s", &s[1]);
  register int ls = strlen(&s[1]);
  register int ans = 1, last = 1;
  for (register int i = 2; i <= ls; i++)
    if (s[i] != s[i - 1])
      last = 1, ans++;
    else
      last = 2, i++, ans++;
  printf("%d\n", ans);
  return 0;
}
