# frozen_string_literal: true

s = gets.chomp
prev = ''
i = 0
c = ''
count = 0
loop do
  c += s[i]
  if c != prev
    count += 1
    prev = c
    c = ''
  end
  i += 1
  break if i == s.size
end

puts count
