S = input()

len_now = len(S)
count = 0
pivot = len(S)-1

while True:
  if len(S)==1:
    break
  elif S[0]=="1" and S[1]=="1":
    break
  elif S[0]=="0" and S[1]=="0":
    break
  
  if S[pivot]=="0" and S[pivot+1]=="1":
    S = S[pivot+2:len(S)]
    count = count + 2
  elif S[pivot]=="1" and S[pivot+1]=="0":
    S = S[pivot+2:len(S)]
    count = count + 2
  pivot = pivot+1

print(count)