s = list(str(input()))

counter = 0
prev = None
while len(s) > 0:
    x = s.pop(0)
    if prev == x:
        if len(s) == 0:
            break

        x += s.pop(0)

    counter += 1
    prev = x

print(int(counter))