S = eval(input())

c0 = 0

c1 = 0

for i in S:

    if i == "0":

        c0 += 1

    else:

        c1 += 1

print((min(c0, c1) * 2))
S = eval(input())

c0 = S.count("0")

c1 = S.count("1")

print((min(c0, c1) * 2))
S = eval(input())
c0 = 0
c1 = 0
for i in S:
    if i == "0":
        c0 += 1
    else:
        c1 += 1
print((min(c0, c1) * 2))

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

-c0 = 0 -c1 = 0 -for i in S: -    if i == "0": -        c0 += 1 -    else: -        c1 += 1 +c0 = S.count("0") +c1 = S.count("1")