s = input()
n = len(s)

for i in range(min(s.count("0"), s.count("1"))):
  s = s.replace("01", "")
for i in range(min(s.count("0"), s.count("1"))):
  s = s.replace("10", "")
  
#print(s)
print(n - len(s))