import math
import sys

line = sys.stdin.readline().rstrip("\n")


maxcount = 0
current_count = 0

for i in line:
    if i == '0':
        current_count += 1
    else:
        if maxcount < current_count:
            maxcount = current_count
        current_count = 0

print(math.ceil(maxcount / 2))
