s=io.read()
counter=1
for i=2,#s do
    checker=true
    if s:sub(i-1,i-1)~=s:sub(i,i) then
        counter=counter+1
    elseif s:sub(i-1,i-1)==s:sub(i,i) then
        if i>=3 then
            counter=counter+0.5
        end
    end
end
print(math.floor(counter))