inp = input()
cnt = 0

inf = 10 ** 5
for i in range(inf):
  cnt_10 = inp.count('10')
  if cnt_10 > 0:
    cnt += cnt_10 * 2
    inp = inp.replace('10','')

  cnt_01 = inp.count('01')
  if cnt_01 > 0:
    cnt += cnt_01 * 2
    inp = inp.replace('01','')  
  
  if (cnt_01 == 0) & (cnt_10 == 0):
    break

print(cnt)