s = str(input())
l = len(s)

counter = 0
prev = None
pivot = 0

while pivot < l:
    n = 1
    if prev == s[pivot]:
        if pivot + 1 < l:
            prev = s[pivot + 2]
            counter += 2
            pivot += 3

        else:
            break
    else:
        counter += 1
        prev = s[pivot]
        pivot += n

print(int(counter))