import itertools
S = input()

S = S[::-1]
pre = S[0]
cnt = 1
i = 1
while i < len(S):
    if S[i] != pre[-1]:
        cnt += 1
        pre = S[i]
        i += 1
    else:
        j = 2
        while j <= len([pre]):
            if S[i:i+j] == pre[:j]:
                j += 1
        cnt += 1
        pre = S[i:i+j]
        i += j
        
print(cnt)