S = input()

offset = 0
non = 0
count = 0
while non == 0 and len(S) >= 2:

    if S[offset] != S[offset + 1]:
        S = S.replace(S[offset],"",1).replace(S[offset+1],"",1)
        count += 2
        offset = -1
    offset += 1
    
    if offset >= len(S)-1:
        non = 1
    
print(count)