s = str(input())

j = 0
count = len(s)
s = [_ for _ in s]
for i in range(0, len(s)-1):
    if j+2 <= len(s)-1:
        if s[j] == s[j+1]:
            j = j+3
            count -= 1
        else:
            continue
    
print(count)