a = input()
sum = 0
i = 0
while True:
  if a[i] == "0" and a[i+1] == "1" and i < len(a)-2 and len(a) > 2:
    sum += 2
    a = a[:i] + a[i+2:]
    i = 0
  elif a[i] == "1" and a[i+1] == "0" and i < len(a)-2 and len(a) > 2:
    sum += 2
    a = a[:i] + a[i+2]
    i = 0
  elif a[i] == "0" and a[i+1] == "1" and i == len(a)-2 and len(a) > 2:
    sum += 2
    a = a[:i]
    i = 0
  elif a[i] == "1" and a[i+1] == "0" and i == len(a)-2 and len(a) > 2:
    sum += 2
    a = a[:i]
    i = 0
  elif len(a) == 2 and a[i] == "0" and a[i+1] == "1":
    sum += 2
    break
  elif len(a) == 2 and a[i] == "1" and a[i+1] == "0":
    sum += 2
    break
  else:
    i += 1
    pass
  
print(sum)