S = input()
S_li = list(S)
count = 0
flag = False
i = 0
while True:
  if i == len(S_li) or len(S_li) == 0:
    break
  if S_li[i-1] == "0" and S_li[i] == "1" and i-1 >= 0:
    flag = True
  elif S_li[i-1] == "1" and S_li[i] == "0" and i-1 >= 0:
    flag = True
  if flag == True:
    del S_li[i-1:i+1]
    count += 2
    i = 0
    flag = False
  else:
    i += 1
print(count)