S = list(input())
N = len(S)
len0 = S.count('0')
len1 = S.count('1')
rm = min(len0,len1)
print(2*rm) S = list(input()) S list(input()) list input() input N = len(S) N len(S) len S len0 = S.count('0') len0 S.count('0') S.count S count '0' len1 = S.count('1') len1 S.count('1') S.count S count '1' rm = min(len0,len1) rm min(len0,len1) min len0 len1 print(2*rm) print 2*rm 2 rm rm = min(len0,len1) min(len0,len1) rm S = list(input()) list(input()) S len0 = S.count('0') S.count('0') len0 len1 = S.count('1') S.count('1') len1 N = len(S) len(S) N
S = list(input())
N = len(S)
len0 = S.count('0')
len1 = S.count('1')
rm = min(len0,len1)
print(2*rm)