s = gets.not_nil!

array = s.split("")
array_answer = [] of String
flag_skip = false

array.each_index do |i|
  begin
    if flag_skip
      flag_skip = false
      next
    end

    if array[i] == array[i - 1]
      array_answer << array[i] + array[i - 1]
      flag_skip = true
    else
      array_answer << array[i]
    end
  rescue
    next
  end
end
puts array_answer.size
