s = open('number.in').read().strip()
assert 1 <= len(s) <= 200000
isValid = lambda a, b : not b.startswith('0') and not a.startswith('0') and a and b and (len(a) < len(b) or a <= b)
l = len(s) // 2
ans = l - s.count('0', 0, l) + (0 if isValid(s[:l], s[l:]) else -1)
if s.startswith('0'):
	ans = 0
open('number.out', 'w').write('%d\n'%max(ans, 0))
