s = input()
n = len(s)
answer = 0
while 1:
  c_01 = s.count("01")
  answer += c_01*2
  s = s.replace("01","")
  
  c_10 = s.count("10")
  answer += c_10*2
  s = s.replace("10","")
  
  if c_01 == 0 and c_10 == 0:
    break
print(answer)