N = [0] + [int(i) for i in input()] ans = 0 while N: if N[-1]==0: N.pop() elif len(N)==1: ans += 1; N.pop() elif N[-1]==1 and N[-2]==0: ans += 1 N.pop() else: ans += 1 while N[-1]==1: N.pop() N[-1] = 1 print(ans)