s = gets.chomp
z = "0"
cnt = 0
i = 0
while i < s.length
  if s[i] != z
    cnt += 1
    z = s[i]
  else
    if i == s.length - 1
      puts cnt
      exit
    end
    z = s[i] + s[i+1]
    i += 1
    cnt += 1
  end
  i += 1
end
puts cnt
