s = eval(input())

s = list(s)

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

a = s.count(1)

b = s.count(0)

print((len(s)-abs(a-b)))
s = eval(input())

rc = s.count("0")

bc = s.count("1")

min1 = min(rc,bc)

print((min1 *2))
s = eval(input())
s = list(s)
s = [int(x) for x in s]
a = s.count(1)
b = s.count(0)
print((len(s) - abs(a - b)))

s = eval(input())
rc = s.count("0")
bc = s.count("1")
min1 = min(rc, bc)
print((min1 * 2))

-s = list(s) -s = [int(x) for x in s] -a = s.count(1) -b = s.count(0) -print((len(s) - abs(a - b))) +rc = s.count("0") +bc = s.count("1") +min1 = min(rc, bc) +print((min1 * 2))