s = gets.chomp

skip = false
count = 1

s.size.times do |i|
  if i == (s.size - 1)
    break
  end
  if skip
    skip = false
    next
  end
  if s[i+1] == s[i]
    count += 1
    skip = true
    # 分割しない
  else
    skip = false
    count += 1
  end
end

puts count
