# frozen_string_literal: true

s = gets

array = s.split('')
array_answer = []
flag_skip = false

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

    if array_answer.last == array[i] + array[i + 1]
      array_answer << array[i]
      next
    end

    if array_answer.last == array[i]
      array_answer << array[i] + array[i + 1]
      flag_skip = true
      next
    end

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