S = list(eval(input()))



count_0 = 0

count_1 = 0



for i in S:

	if i == "0":

		count_0 += 1

	if i == "1":

		count_1 += 1



print((min(count_0, count_1)*2))
S = list(eval(input()))

 

cnt0 = S.count("0")

cnt1 = S.count("1")

 

print((min(cnt0, cnt1) * 2))
S = list(eval(input()))
count_0 = 0
count_1 = 0
for i in S:
    if i == "0":
        count_0 += 1
    if i == "1":
        count_1 += 1
print((min(count_0, count_1) * 2))

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

-count_0 = 0 -count_1 = 0 -for i in S: -    if i == "0": -        count_0 += 1 -    if i == "1": -        count_1 += 1 -print((min(count_0, count_1) * 2)) +cnt0 = S.count("0") +cnt1 = S.count("1") +print((min(cnt0, cnt1) * 2))