S = gets.chomp

ans = 1
queue = S.chars
before = queue.shift
current = ''

until queue.empty?
  current += queue.shift

  if before != current
    ans += 1
    before = current
    current = ''
  end
end

puts ans
