s=eval(input())

ans=int(0)

n=len(s)

b=int(0)

w=int(0)

for i in range(n):

    if s[i]=='0':

        b+=1

    else:

        w+=1



if b<w:

    print((2*b))

else:

    print((2*w))
s=str(eval(input()))

n=len(s)

b=s.count('0')

A=[b,n-b]

print((min(A)+min(A)))
s = eval(input())
ans = int(0)
n = len(s)
b = int(0)
w = int(0)
for i in range(n):
    if s[i] == "0":
        b += 1
    else:
        w += 1
if b < w:
    print((2 * b))
else:
    print((2 * w))

s = str(eval(input()))
n = len(s)
b = s.count("0")
A = [b, n - b]
print((min(A) + min(A)))

-s = eval(input()) -ans = int(0) +s = str(eval(input())) -b = int(0) -w = int(0) -for i in range(n): -    if s[i] == "0": -        b += 1 -    else: -        w += 1 -if b < w: -    print((2 * b)) -else: -    print((2 * w)) +b = s.count("0") +A = [b, n - b] +print((min(A) + min(A)))