S = eval(input())

c0 = 0

c1 = 0

for i in range(len(S)):

    if S[i] == '0':

        c0 += 1

    else:

        c1 += 1

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

print((min(S.count('0'), S.count('1')) * 2))
S = eval(input())
c0 = 0
c1 = 0
for i in range(len(S)):
    if S[i] == "0":
        c0 += 1
    else:
        c1 += 1
print((min(c0, c1) * 2))

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

-c0 = 0 -c1 = 0 -for i in range(len(S)): -    if S[i] == "0": -        c0 += 1 -    else: -        c1 += 1 -print((min(c0, c1) * 2)) +print((min(S.count("0"), S.count("1")) * 2))