S = eval(input())

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

l = len(S)

a = S.count('0')

print((2 * min(a, l - a)))

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

S = eval(input())
l = len(S)
a = S.count("0")
print((2 * min(a, l - a)))

-print((2 * min(S.count("0"), S.count("1")))) +l = len(S) +a = S.count("0") +print((2 * min(a, l - a)))