n = list(str(eval(input())))

a = 0

b = 0

for i in n:

    if i == "1":

        a += 1

    else:

        b += 1



c = min(a,b)



print((2 * c))
n = list(str(eval(input())))

a = n.count("1")

b = n.count("0")



c = min(a,b)



print((2 * c))
n = list(str(eval(input())))
a = 0
b = 0
for i in n:
    if i == "1":
        a += 1
    else:
        b += 1
c = min(a, b)
print((2 * c))

n = list(str(eval(input())))
a = n.count("1")
b = n.count("0")
c = min(a, b)
print((2 * c))

-a = 0 -b = 0 -for i in n: -    if i == "1": -        a += 1 -    else: -        b += 1 +a = n.count("1") +b = n.count("0")