s=gets.chomp
n=s.length
i=0
count=1

if n==2 && s[0]==s[1]
    puts 1
    return
end

while i<n-1
    if s[i]!=s[i+1]
        count+=1
        i+=1
    else
        count+=1
        i+=2
    end
end
puts count
