#11011010001011
#['1', '1', '0', '1', '1', '0', '1', '0', '0', '0', '1', '0', '1', '1']
#
#['1',     '1']


S=list(raw_input())
#print S

tmp_len=0
count=0
pre_len=len(S)

while tmp_len != pre_len:
    i=0
    pre_len = tmp_len
#    print S ,"<==="
    while i < (len(S)-1):
#        print i,S,"<="
        if S[i] != S[i+1]:
            S.pop(i+1)
            S.pop(i)
            count += 2
            tmp_len=len(S)
        i += 1

print count
