import sys

s = str(sys.stdin.readline())
count = 0
f = False
while True:
  for i in range(len(s)-1):
    if s[i] == '0' and s[i+1] == '1':
      count += 2
      s = s[:i] + s[i+2:]
      f = True
      break 
    if s[i] == '1' and s[i+1] == '0':
      count += 2
      f = True
      s = s[:i] + s[i+2:]
      break 
  if f:
    f = False
    continue
  break
print(count)