s = input()

cnt_0 = 0
cnt_1 = 0

for i in range(len(s)):
    if s[i] == "0":
        cnt_0 += 1
    else:
        cnt_1 += 1

print(2*min(cnt_0, cnt_1)) s = input() s input() input cnt_0 = 0 cnt_0 0 cnt_1 = 0 cnt_1 0 for i in range(len(s)):
    if s[i] == "0":
        cnt_0 += 1
    else:
        cnt_1 += 1 i range(len(s)) range len(s) len s if s[i] == "0":
        cnt_0 += 1
    else:
        cnt_1 += 1 s[i] == "0" s[i] s i "0" cnt_0 += 1 cnt_0 1 cnt_1 += 1 cnt_1 1 print(2*min(cnt_0, cnt_1)) print 2*min(cnt_0, cnt_1) 2 min(cnt_0, cnt_1) min cnt_0 cnt_1 cnt_0 = 0 0 cnt_0 s = input() input() s cnt_1 += 1 1 cnt_1 cnt_1 = 0 0 cnt_1 cnt_0 += 1 1 cnt_0
s = input()

cnt_0 = 0
cnt_1 = 0

for i in range(len(s)):
    if s[i] == "0":
        cnt_0 += 1
    else:
        cnt_1 += 1

print(2*min(cnt_0, cnt_1))
