S = input()
N = len(S)

tmp = S
a = 0
b = 0
c = 0
count = 0
if len(tmp)-1 == b:
    a = 1

while a == 0:
    if tmp[b] != tmp[b+1]:
        count += 1
        #print('取り除くもの')
        #print(tmp[b:b+2])
        tmp = tmp[:b] + tmp[b+2:]
        #print('取り除いた後')
        #print(tmp)
        b = 0
        c += 1
        if len(tmp)-1 == b or len(tmp) == 0: 
            a = 1

    else:
        b += 1
        if len(tmp)-1 == b or len(tmp) == 0: 
            a = 1

print(str(count*2))