s = input()

last = ' '
ans = 0
i=0
while i < len(s):
    if i == len(s)-2 and last == s[i+1]:
        ans+=1
        break
    ans += 1
    if last == s[i]:
        i+=2
        last = ' '
        continue
    last = s[i]
    i+=1
print(ans)