s = input()
l = int(len(s)/2)
def erase_01_10(moji):
  if moji.count('01')>0:
    moji = moji.replace('01','',1)
  elif moji.count('10')>0:
    moji = moji.replace('10','',1)
  return moji
count=0
for i in range(l):
  if s == erase_01_10(s):
    break
  s = erase_01_10(s)
  count+=2
print(count)
