#require 'pp'

#memo = {}
chs = gets.chomp!.chars


count = 1
before = chs[0]
i = 1
while i < chs.length
    #puts chs[i]
    if before != chs[i]
        before = chs[i]
        i += 1
    else
        before = chs[i+1]
        i += 2
    end
    count += 1
end

puts count
