S=eval(input())



red=0

blue=0



for i in range(len(S)):

    if S[i]=="0":

        red+=1

    else:

        blue+=1



print((min(red,blue)*2))
S=eval(input())



count_1=0

count_0=0



for s in S:

    if s=="0":

        count_0+=1

    else:

        count_1+=1



print((min(count_0,count_1)*2))
S = eval(input())
red = 0
blue = 0
for i in range(len(S)):
    if S[i] == "0":
        red += 1
    else:
        blue += 1
print((min(red, blue) * 2))

S = eval(input())
count_1 = 0
count_0 = 0
for s in S:
    if s == "0":
        count_0 += 1
    else:
        count_1 += 1
print((min(count_0, count_1) * 2))

-red = 0 -blue = 0 -for i in range(len(S)): -    if S[i] == "0": -        red += 1 +count_1 = 0 +count_0 = 0 +for s in S: +    if s == "0": +        count_0 += 1 -        blue += 1 -print((min(red, blue) * 2)) +        count_1 += 1 +print((min(count_0, count_1) * 2))