s = eval(input())

print((2 * min([sum([v == '1' for v in s]), sum([v == '0' for v in s])])))
S = eval(input())

print((min(S.count('0'), S.count('1')) * 2))
s = eval(input())
print((2 * min([sum([v == "1" for v in s]), sum([v == "0" for v in s])])))

S = eval(input())
print((min(S.count("0"), S.count("1")) * 2))

-s = eval(input()) -print((2 * min([sum([v == "1" for v in s]), sum([v == "0" for v in s])]))) +S = eval(input()) +print((min(S.count("0"), S.count("1")) * 2))