string = str(input())
zero = 0
one = 0
for char in string:
    if char == list(chars)[0]:
        zero += 1
    else:
        one += 1

if zero == 0 or one == 0:
    print(0)
else:
    print(min(zero, one) * 2)