i = input()

prev = ""
res = 0
index = 0
while index < len(i):
    temp = i[index]
    if temp == prev:
        prev = i[index:index+2]
        index += 2
    else:
        prev = i[index]
        index += 1
    res += 1

print(res)