S = input()
ans =0
for i in range(1,10**5):
  if S.count('0') ==0 or S.count('1') ==0:
      break
  for j in range(1,10**5):
      if S[j] != S[j-1]:
          S= S[0:j-1]+S[j+1:]
          ans +=2
          break
    
print(ans)