S = list(eval(input()))

num_one = S.count("1")

num_zero = S.count("0")

ans = min(num_one, num_zero) *2

print(ans)

S = eval(input())



ans = min(S.count("0"), S.count("1")) * 2

print(ans)

S = list(eval(input()))
num_one = S.count("1")
num_zero = S.count("0")
ans = min(num_one, num_zero) * 2
print(ans)

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

-S = list(eval(input())) -num_one = S.count("1") -num_zero = S.count("0") -ans = min(num_one, num_zero) * 2 +S = eval(input()) +ans = min(S.count("0"), S.count("1")) * 2