s=list(eval(input()))

n=len(s)

zero=s.count("0")

one=s.count("1")

if n==1:print((0))

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

print((2*min(s.count("0"),s.count("1"))))
s = list(eval(input()))
n = len(s)
zero = s.count("0")
one = s.count("1")
if n == 1:
    print((0))
else:
    print((2 * min(zero, one)))

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

-s = list(eval(input())) -n = len(s) -zero = s.count("0") -one = s.count("1") -if n == 1: -    print((0)) -else: -    print((2 * min(zero, one))) +s = eval(input()) +print((2 * min(s.count("0"), s.count("1"))))