s = gets.chomp!

ans = 0
pre = ""
x = false
s.length.times do |i|
    #p [x,i,pre]
    if x 
        x = false
        next
    end

    if s[i] == pre
        x = true
        pre = ""
    else
        pre = s[i]
    end
    ans += 1
end

puts x ? ans - 1 : ans