s = list(input())
i = 1

while i < len(s) - 1:
    if s[i - 1] == s[i]:
        s[i] = s[i] + s[i + 1]
        s.pop(i + 1)
        len(s)
    i += 1

if s[len(s) - 1] == s[len(s) - 2]:
    s.pop(len(s) - 1)

print(len(s))
