S = str(input())

#(S[i - 1] == '1' and S[i] == '0') or (S[i - 1] == '0' and S[i] == '1')

S_dict = {}
for letter in S:
    if letter == '1':
        if letter in S_dict:
            S_dict[letter] += 1
        else:
            S_dict[letter] = 1
    elif letter == '0':
        if letter in S_dict:
            S_dict[letter] += 1
        else:
            S_dict[letter] = 1
        
print(min(S_dict.values()) * 2)