s = eval(input())

t = len([c for c in s if c == '0'])

print((2 * min(t, len(s) - t)))

s = eval(input())

t = s.count('0')

print((2 * min(t, len(s) - t)))

s = eval(input())
t = len([c for c in s if c == "0"])
print((2 * min(t, len(s) - t)))

s = eval(input())
t = s.count("0")
print((2 * min(t, len(s) - t)))

-t = len([c for c in s if c == "0"]) +t = s.count("0")