from collections import Counter

cnt=Counter(input())

print(2*min(cnt['0'],cnt['1']))
from collections import Counter

cnt=Counter(eval(input()))

print((2*min(cnt['0'],cnt['1'])))
from collections import Counter

cnt = Counter(input())
print(2 * min(cnt["0"], cnt["1"]))

from collections import Counter

cnt = Counter(eval(input()))
print((2 * min(cnt["0"], cnt["1"])))

-cnt = Counter(input()) -print(2 * min(cnt["0"], cnt["1"])) +cnt = Counter(eval(input())) +print((2 * min(cnt["0"], cnt["1"])))