
def check(S, Flag, counter):
    for i in range(len(S)-1):
        if S[i] != S[i+1]:
            S = S[:i] + S[i+2:]
            #print(S)
            counter += 2
            break
        else:
            continue
    return S, Flag, counter

S = list(input())
Flag = True
counter = 0

while Flag:
    S, Flag, counter = check(S, Flag, counter)
    if S.count('1') == len(S) or S.count('0') == len(S):
        Flag = False
print(counter)
