from sys import stdin
def main(mx=max):
    s = stdin.readline().strip()
    ans = [{'': -1001001001}, {'': 0}]
    for i, c in enumerate(s):
        d = {}
        if i:
            t = s[i-1] + c
            x = mx(-1001001001 if k == t else v for k, v in ans[0].viewitems())
            d[t] = x + 1
        x = mx(-1001001001 if k == c else v for k, v in ans[1].viewitems())
        d[c] = x + 1
        ans = [ans[1], d]
    print mx(ans[1].values())
main()
