S = input()
flag0 = False
flag1 = False
counter = 0
while True:
    idx = S.find("01")
    if idx>0:
        S = S[:idx] + S[idx+2:]
        counter += 2
    else:
        flag0 = True
    
    idx = S.find("10")
    if idx>0:
        S = S[:idx] + S[idx+2:]
        counter += 2
    else:
        flag1 = True

    if flag0 and flag1 :
        break
print(counter)