left = []
right = gets.chomp.split("")
count = 0
(right.size + 1).times {
	if !right.empty? && right[0] == ?0
		left << right.shift
		next
	end
	l = left.join.to_i
	r = right.join.to_i
	if (l + r).odd?
		left << right.shift
		next
	end
	x = (l + r) / 2
	count += 1 if r >= x

	left << right.shift
}
p count