A = list(eval(input()))

#print(A.count("1"))

print((2 * min((A.count("1"),A.count("0")))))

S = eval(input())

n = S.count("0")

print((min(n, len(S) - n) * 2))

A = list(eval(input()))
# print(A.count("1"))
print((2 * min((A.count("1"), A.count("0")))))

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

-A = list(eval(input())) -# print(A.count("1")) -print((2 * min((A.count("1"), A.count("0"))))) +S = eval(input()) +n = S.count("0") +print((min(n, len(S) - n) * 2))