S = input()

last = "X"

ls = len(S)

pointer = 0
ans = 0

while pointer < ls - 1:
    # 1文字の列にして良い時
    if last != S[pointer]:
        last = S[pointer]
    # 次の文字と合わせなければいけないとき
    else:
        pointer += 1
        last = "X"

    ans += 1
    pointer += 1

if last != S[ls-1]:
    ans += 1

print(ans)