S = str(input())
count = 0
i = 0
def flag():
  global S,i,count
  S = S[i-1] + S[i+1:]
  count += 2
  i = 0
while True:
  if i == len(S) or len(S) == 0:
    break
  elif S[i-1] == "0" and S[i] == "1" and i-1 >= 0:
    flag()
  elif S[i-1] == "1" and S[i] == "0" and i-1 >= 0:
    flag()
  i += 1
print(count)