N = int(input(),2) ans = 0 while N: v=N&3 if v==0: N >>= 2 elif v==1: ans += 1 N >>= 2 elif v==2: N >>= 1 else: ans += 1 N += 1 N >>= 2 print(ans)