S = list(input())
S = [int(s) for s in S]
N = len(S)
#print('S:', S)

count=0
i=1
while True:
    #print(S,i)
    if len(S)==0 or len(S)==1 or sum(S)==len(S) or sum(S)==0 :
        break

    elif S[i-1] != S[i]:
        del S[i-1]
        del S[i-1]
        count+=1
        i=1
    else:
        i+=1

print(count*2)