S = eval(input())



zero = 0

one = 0



for ch in S:

    if ch == "0":

        zero = zero + 1

    else:

        one = one + 1



print((min(zero, one) * 2))

S = eval(input())

z = S.count("0")

o = S.count("1")



print((min(z, o) * 2))

S = eval(input())
zero = 0
one = 0
for ch in S:
    if ch == "0":
        zero = zero + 1
    else:
        one = one + 1
print((min(zero, one) * 2))

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

-zero = 0 -one = 0 -for ch in S: -    if ch == "0": -        zero = zero + 1 -    else: -        one = one + 1 -print((min(zero, one) * 2)) +z = S.count("0") +o = S.count("1") +print((min(z, o) * 2))