import sys

data= sys.stdin.readline()

a = data.count("01")
b = data.count("10")
c = 0
while a != 0 and b != 0:
    if a > 0:
        c += a * 2
        data = data.replace("01", "")
        a = data.count("01")
        b = data.count("10")
        
    if b > 0:
        c += b * 2
        data = data.replace("10", "")
        a = data.count("01")
        b = data.count("10")
    
print(c)