P=list(map(int,list(input())));print(min(sum(P),len(P)-sum(P))*2)
P=input();print(min(P.count('0'),P.count('1'))*2)
P = list(map(int, list(input())))
print(min(sum(P), len(P) - sum(P)) * 2)

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

-P = list(map(int, list(input()))) -print(min(sum(P), len(P) - sum(P)) * 2) +P = input() +print(min(P.count("0"), P.count("1")) * 2)