s=eval(input())

zero=0

one=0

for i in s:

  if(i=='0'):

    zero+=1

  elif(i=='1'):

    one+=1

print((min(one,zero)*2))
s=eval(input())

print((min(s.count("1"),s.count("0"))*2))
s = eval(input())
zero = 0
one = 0
for i in s:
    if i == "0":
        zero += 1
    elif i == "1":
        one += 1
print((min(one, zero) * 2))

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

-zero = 0 -one = 0 -for i in s: -    if i == "0": -        zero += 1 -    elif i == "1": -        one += 1 -print((min(one, zero) * 2)) +print((min(s.count("1"), s.count("0")) * 2))