#python 3.7.1

s = list(eval(input()))

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

n = 0

r = 0

b = 0

for i in s:

	if s[n] == 0:

		r += 1

	elif s[n] == 1:

		b += 1

	n += 1

print((min(r,b) * 2))
s = list(eval(input()))

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

count_one = 0

count_zero = 0

for i in s:

    if i == 0:

        count_zero += 1

    else:

        count_one += 1

print((min(count_one, count_zero) * 2))

# python 3.7.1
s = list(eval(input()))
s = [int(i) for i in s]
n = 0
r = 0
b = 0
for i in s:
    if s[n] == 0:
        r += 1
    elif s[n] == 1:
        b += 1
    n += 1
print((min(r, b) * 2))

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

-# python 3.7.1 -n = 0 -r = 0 -b = 0 +count_one = 0 +count_zero = 0 -    if s[n] == 0: -        r += 1 -    elif s[n] == 1: -        b += 1 -    n += 1 -print((min(r, b) * 2)) +    if i == 0: +        count_zero += 1 +    else: +        count_one += 1 +print((min(count_one, count_zero) * 2))