S = str(eval(input()))

zero = 0

one = 0

for i in S:

  if i == "0":

    zero += 1

  else:

    one += 1

ans = min(zero,one)*2

print(ans)
from collections import Counter

S = str(eval(input()))

SC = Counter(S)

v,c = list(zip(*SC.most_common()))

if len(c) == 2:

  print((len(S) - abs(c[1]-c[0])))

else:

  print((0))
S = str(eval(input()))
zero = 0
one = 0
for i in S:
    if i == "0":
        zero += 1
    else:
        one += 1
ans = min(zero, one) * 2
print(ans)

from collections import Counter

S = str(eval(input()))
SC = Counter(S)
v, c = list(zip(*SC.most_common()))
if len(c) == 2:
    print((len(S) - abs(c[1] - c[0])))
else:
    print((0))

+from collections import Counter + -zero = 0 -one = 0 -for i in S: -    if i == "0": -        zero += 1 -    else: -        one += 1 -ans = min(zero, one) * 2 -print(ans) +SC = Counter(S) +v, c = list(zip(*SC.most_common())) +if len(c) == 2: +    print((len(S) - abs(c[1] - c[0]))) +else: +    print((0))