s = input()
ans = 0
f = 0
while f == 0:
  for i in range(len(s) - 1):
    if s[i] == s[i + 1]:
      next
    else:
      ans += 2
      s = s[:i] + s[i + 2:]
      break
  if s.count('0') == 0 or s.count('1') == 0:
    f =1 
    break
print(ans)    