A = list(eval(input()))

N = len(A)



C0 = A.count("0")

C1 = A.count("1")



print((2 * min(C0, C1)))

s = list(eval(input()))



n = len(s)

c_0 = s.count("0")

c_1 = n - c_0



ans = min(c_0, c_1) * 2



print(ans)
A = list(eval(input()))
N = len(A)
C0 = A.count("0")
C1 = A.count("1")
print((2 * min(C0, C1)))

s = list(eval(input()))
n = len(s)
c_0 = s.count("0")
c_1 = n - c_0
ans = min(c_0, c_1) * 2
print(ans)

-A = list(eval(input())) -N = len(A) -C0 = A.count("0") -C1 = A.count("1") -print((2 * min(C0, C1))) +s = list(eval(input())) +n = len(s) +c_0 = s.count("0") +c_1 = n - c_0 +ans = min(c_0, c_1) * 2 +print(ans)