S = list(input()) ans = 0 one = 0 for s in S: if s == '1': one += 1 else: if one == 1: one = 0 ans += one // 2 print(ans)