s = input()

cnt = 0
temp = 0

while True:
    cnt += s.count("01") * 2
    s = s.replace("01","")
    
    cnt += s.count("10") * 2
    s = s.replace("10","")
    
    if temp == cnt:
        break
    temp = cnt
    
print(cnt)