def solve(s, i)
  if i < 3
    return 1
  elsif s[i] != s[i - 1]
    return solve(s, i - 1) + 1
  else
    return solve(s, i - 3) + 2
  end
end

s = ("_" + gets.chomp).chars
n = s.size - 1
puts solve(s, n)