s = input()
n = len(s)
ans = 0
if n < 1:
  print(0)
else:
  a,b = s.count('0'), s.count('1')
  for _ in range(min(a,b)+1):
    c, d = s.count('01'), s.count('10')
    print(s)
    if len(s) <= 0 or c+d <= 0:
      break
    c = s.count('01')
    if c > 0:
      ans += c*2
      s = s.replace('01', '')
    d = s.count('10')
    if d > 0:
      ans += d*2
      s = s.replace('10', '')

print(ans)