s = list(input())
new_s = [s[0]]
i = 0
while i<=len(s)-3:
    if s[i+1] != s[i]:
        new_s.append(s[i+1])
        i +=1
    else:
        new_s.append(s[i+1]+s[i+2])
        i +=2
if s[len(s)-1] == s[len(s)-2]:
    pass
else:
    new_s.append(s[len(s)-1])
print(len(new_s))