inputs = readlines

s = inputs[0].chomp

pre_word = "0"
word = ""
count = 0

s.chars do |c|
  word += c
  unless pre_word == word
    pre_word = word
    word = ""
    count += 1
  end
end

puts count
