s = gets.strip.split('')

result=1
pre=[s.shift]
current = []
s.each_with_index do |c, i|
#p [pre, current, result]
  current.push(c)
  if !pre.empty? && pre != current
    result += 1
    pre = current
    current=[]
  end
end

p result
