S = input()

last = S[0]
ans = 1
cnt = 1

while cnt < len(S):
    if len(last)==1:
        if last != S[cnt]:
            last = S[cnt]
            ans += 1
            cnt += 1
        else:
            last = S[cnt:cnt+2]
            ans += 1
            cnt += 2
    if len(last)==2:
        last = S[cnt]
        ans += 1
        cnt += 1

print(ans)