arr = []
inp = input()
dist = 0
maxI = 0
for i in inp:
    if i == '1':
        if dist > maxI:
            maxI = dist
        dist = 0
    if i == '0':
        dist += 1
if dist > ((maxI + 1) // 2):
    print(dist)
else:
    print((maxI + 1) // 2)
