s=io.read()
counter=0
previous=""
current=""
for i=1,#s do
    current=current+s:sub(i,i)
    if current~=previous then
        previous=current
        current=""
        counter=counter+1
    end
end
print(counter)