S = str(eval(input()))



zero_num = 0



for i in range(len(S)):

    if S[i] == "0":

        zero_num += 1



print((2*min(zero_num, len(S) - zero_num)))
S = str(eval(input()))



zero_num = S.count("0")



print((2*min(zero_num, len(S) - zero_num)))
S = str(eval(input()))
zero_num = 0
for i in range(len(S)):
    if S[i] == "0":
        zero_num += 1
print((2 * min(zero_num, len(S) - zero_num)))

S = str(eval(input()))
zero_num = S.count("0")
print((2 * min(zero_num, len(S) - zero_num)))

-zero_num = 0 -for i in range(len(S)): -    if S[i] == "0": -        zero_num += 1 +zero_num = S.count("0")