a = input()
sum = 0
for i in range(len(a)):
  if a[i] == "0" and a[i+1] == "1" and i < len(a-2):
    sum += 2
    a = a[:i] + a[i+2:]
  elif a[i] == "1" and a[i+1] == "0" and i < len(a-2):
    sum += 2
    a = a[:i] + a[i+2]
  elif a[i] == "0" and a[i+1] == "1" and i == len(a-2):
    sum += 2
    a = a[:i]
  elif a[i] == "1" and a[i+1] == "0" and i == len(a-2):
    sum += 2
    a = a[:i]
  else:
    pass
print(sum)