S = str(input())
x = len(S)
if '0' in S:
  y0 = S.count('0')
else:
  y0 = 0
if '1' in S:
  y1 = S.count('1')
else:
  y1 = 0
  
d = abs(y0 - y1)
print(x - d) S = str(input()) S str(input()) str input() input x = len(S) x len(S) len S if '0' in S:
  y0 = S.count('0')
else:
  y0 = 0 '0' in S '0' S y0 = S.count('0') y0 S.count('0') S.count S count '0' y0 = 0 y0 0 if '1' in S:
  y1 = S.count('1')
else:
  y1 = 0
   '1' in S '1' S y1 = S.count('1') y1 S.count('1') S.count S count '1' y1 = 0 y1 0 d = abs(y0 - y1) d abs(y0 - y1) abs y0 - y1 y0 y1 print(x - d) print x - d x d y1 = S.count('1') S.count('1') y1 d = abs(y0 - y1) abs(y0 - y1) d S = str(input()) str(input()) S y0 = 0 0 y0 y0 = S.count('0') S.count('0') y0 y1 = 0 0 y1 x = len(S) len(S) x
S = str(input())
x = len(S)
if '0' in S:
  y0 = S.count('0')
else:
  y0 = 0
if '1' in S:
  y1 = S.count('1')
else:
  y1 = 0
  
d = abs(y0 - y1)
print(x - d)
