s = input()
cnt_1 = 0

for i in s:
    if i == '1':
        cnt_1 += 1
        
print(min(cnt_1, len(s) - cnt_1) * 2) s = input() s input() input cnt_1 = 0 cnt_1 0 for i in s:
    if i == '1':
        cnt_1 += 1
         i s if i == '1':
        cnt_1 += 1
         i == '1' i '1' cnt_1 += 1 cnt_1 1 print(min(cnt_1, len(s) - cnt_1) * 2) print min(cnt_1, len(s) - cnt_1) * 2 min(cnt_1, len(s) - cnt_1) min cnt_1 len(s) - cnt_1 len(s) len s cnt_1 2 cnt_1 = 0 0 cnt_1 cnt_1 += 1 1 cnt_1 s = input() input() s
s = input()
cnt_1 = 0

for i in s:
    if i == '1':
        cnt_1 += 1
        
print(min(cnt_1, len(s) - cnt_1) * 2)