S = input()
a = S[0]
count = 1
flag = 1
if len(S) == 1:
    print(1)
else:
    for i in range(1, len(S)):
        if a != S[i] or flag == 0:
            count += 1
            flag = 1
        else:
            flag = 0
        a = S[i]
    print(count)