import sys
sys.setrecursionlimit(10000)
# 再帰関数
# 入力文字列の最大の正整数を返す
def func( in_str: str, prev: str ):
    if len(in_str) == 0:
        return 0
    num = 0
    new_str = ""
    for i in range(len(in_str)):
        s = in_str[0:i+1]
        if s == prev:
            continue
        else:
            new_str = in_str[i+1:]
            ret = func(new_str, s)
            if ret == -1:
                continue
            return 1 + ret

    return -1


s = input()
#s="aaaccacabaldkfjadhjdhafidhkajhdkfjahdskjhfakhdkfaababc"*1000
num = func( s, "")

print(num)