s = gets.chomp.split('')

count = 1
i = 1
while i < s.length
    if s[i] == s[i - 1] then
        i += 1
        if i < s.length then
            i += 1
            count += 1
            if i < s.length then
                i += 1
                count += 1
            end
        end
    else
        i += 1
        count += 1
    end
end

puts count
