import sys

def main():
  input = sys.stdin.readline
  S = [int(c) for c in input().strip()]
  n1 = 0
  n0 = 0
  c = 0
  for i in S:
    if i == 0:
      if n1 > 1:
        c += 2
        n1 -= 1
      else:
        n0 += 1
    else:
      if n0 > 0:
        c += 2
        n0 -= 1
      else:
        n1 += 1
  print(c)


if __name__ == '__main__':
  main()