s = gets.chomp.split('')
current = ''
pre = ''
ans = 0

0.upto(s.length - 1) do |i|
    current += s[i]
    
    if current != pre
        ans += 1
        pre = current
        current = ''
    end
end

puts ans