s = list(input())

length = len(s)

r = s.count('0')
b = s.count('1')

print(length - abs(r-b)) s = list(input()) s list(input()) list input() input length = len(s) length len(s) len s r = s.count('0') r s.count('0') s.count s count '0' b = s.count('1') b s.count('1') s.count s count '1' print(length - abs(r-b)) print length - abs(r-b) length abs(r-b) abs r-b r b b = s.count('1') s.count('1') b r = s.count('0') s.count('0') r s = list(input()) list(input()) s length = len(s) len(s) length
s = list(input())

length = len(s)

r = s.count('0')
b = s.count('1')

print(length - abs(r-b))