s = list(input())
count = 0
while s != []:
    if len(s) > 1:
        if s[0] != s[1]:
            count += 1
            del s[0]
        elif s[0] == s[1]:
            count += 2
            del s[0:3]
            if s == []:
                count -= 1
    elif len(s) == 1:
        count += 1
        del s[0]

print(count)