string = input()

before = ""
ans = 0
while len(string) > 1:
    if before == string[0]:
        temp = string[0:2]
        string = string[2:len(string)]
    else:
        temp = string[0]
        string = string[1:len(string)]
    before = temp
    ans += 1
if not before == string:
    ans += 1
print(ans)