s = set() c = input() ans = 0 for i in range(len(c)-1): if not (c[:i+1][0] == "0" or c[i+1:][0] == "0"): ans += 1 print(ans)