C = input() print(len(C) - C[1:].count("0") - 1)