S = input()
result = ["0"]
hoge = []

i=0
while( i<len(S)-1 ):
    hoge = S[i]
    if result[-1] == hoge :
        result.append(S[i]+S[i+1])
        i+=1
    else:
        result.append(S[i])
    i+=1

#最後の一文字
if result[-1]==S[-1]:
    result[-1]+=S[-1]
else:
    result.append(S[-1])

print(len(result)-1)