S=list(str(input()))
zero=S.count("0")
one=S.count("1")
if zero==0 or one==0:
  print(0)
else:
  print(min(zero,one)*2) S=list(str(input())) S list(str(input())) list str(input()) str input() input zero=S.count("0") zero S.count("0") S.count S count "0" one=S.count("1") one S.count("1") S.count S count "1" if zero==0 or one==0:
  print(0)
else:
  print(min(zero,one)*2) zero==0 or one==0 zero==0 zero 0 one==0 one 0 print(0) print 0 print(min(zero,one)*2) print min(zero,one)*2 min(zero,one) min zero one 2 one=S.count("1") S.count("1") one S=list(str(input())) list(str(input())) S zero=S.count("0") S.count("0") zero
S=list(str(input()))
zero=S.count("0")
one=S.count("1")
if zero==0 or one==0:
  print(0)
else:
  print(min(zero,one)*2)