S = input()

ans = 1
sl = 'a'
sr = ''
for i in range(1, len(S)):
    current_sr = sr + S[i]
    if sl != current_sr:
        ans += 1
        sl = current_sr
        sr = ''
    else:
        sr = current_sr

print(ans)
