mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline S = input().rstrip('\n') A = [int(s) for s in S[::-1]] + [0] N = len(A) ans = 0 for i in range(N-1): if A[i]: if not A[i+1]: ans += 1 else: ans += 1 j = i while True: if A[j] == 1: A[j] = 0 j += 1 else: A[j] = 1 break if A[-1]: ans += 1 print(ans) if __name__ == '__main__': main()