S = list(input())

blue = S.count('1')
red = S.count('0')

print(len(S) - abs(blue - red)) S = list(input()) S list(input()) list input() input blue = S.count('1') blue S.count('1') S.count S count '1' red = S.count('0') red S.count('0') S.count S count '0' print(len(S) - abs(blue - red)) print len(S) - abs(blue - red) len(S) len S abs(blue - red) abs blue - red blue red S = list(input()) list(input()) S blue = S.count('1') S.count('1') blue red = S.count('0') S.count('0') red
S = list(input())

blue = S.count('1')
red = S.count('0')

print(len(S) - abs(blue - red))