s = input()
# aabbaa

ans = 1 if s[-1] != s[-2] else 0
prev = ""
i = 0
while i < len(s) - 1: # i < 4
    if prev != s[i]:
        ans += 1
        prev = s[i]
        i += 1
    else:
        ans += 1
        prev = s[i:i+2]
        i += 2

print(ans)
