s = [int(i) for i in eval(input())]



cnt = [0,0]

for i in s:

    if i==0:

        cnt[0] += 1

    else:

        cnt[1] += 1

print((min(cnt)*2))
s = eval(input())

cnt = [0,0]

cnt[0] = s.count('0')

cnt[1] = s.count('1')

print((min(cnt)*2))
s = [int(i) for i in eval(input())]
cnt = [0, 0]
for i in s:
    if i == 0:
        cnt[0] += 1
    else:
        cnt[1] += 1
print((min(cnt) * 2))

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

-s = [int(i) for i in eval(input())] +s = eval(input()) -for i in s: -    if i == 0: -        cnt[0] += 1 -    else: -        cnt[1] += 1 +cnt[0] = s.count("0") +cnt[1] = s.count("1")