S = eval(input())

A = 0

B = 0

for i in range(len(S)):

  if S[i] == "0":

    A += 1

  else:

    B += 1

print((min(A,B)*2))

S = eval(input())

K = S.count("0")

L = S.count("1")

print((min(K,L)*2))
S = eval(input())
A = 0
B = 0
for i in range(len(S)):
    if S[i] == "0":
        A += 1
    else:
        B += 1
print((min(A, B) * 2))

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

-A = 0 -B = 0 -for i in range(len(S)): -    if S[i] == "0": -        A += 1 -    else: -        B += 1 -print((min(A, B) * 2)) +K = S.count("0") +L = S.count("1") +print((min(K, L) * 2))