s = input()

p = len(s)
cnt = 0
temp = 0

while True:
    s = s.replace("01","")
    s = s.replace("10","")
    
    cnt = len(s)
    
    if temp == cnt:
        break
    temp = cnt
    
print(p - cnt)