S = input().strip()
z = 0
o = 0
r = 0
for s in S:
    if s == "0":
        if o > 0:
            o -= 1
            r += 2
        else:
            z += 1
    elif s == "1":
        if z > 0:
            z -= 1
            r += 2
        else:
            o += 1
print(r) S = input().strip() S input().strip() ().strip () input strip z = 0 z 0 o = 0 o 0 r = 0 r 0 for s in S:
    if s == "0":
        if o > 0:
            o -= 1
            r += 2
        else:
            z += 1
    elif s == "1":
        if z > 0:
            z -= 1
            r += 2
        else:
            o += 1 s S if s == "0":
        if o > 0:
            o -= 1
            r += 2
        else:
            z += 1
    elif s == "1":
        if z > 0:
            z -= 1
            r += 2
        else:
            o += 1 s == "0" s "0" if o > 0:
            o -= 1
            r += 2
        else:
            z += 1
     o > 0 o 0 o -= 1 o 1 r += 2 r 2 z += 1 z 1 elif s == "1":
        if z > 0:
            z -= 1
            r += 2
        else:
            o += 1 s == "1" s "1" if z > 0:
            z -= 1
            r += 2
        else:
            o += 1 z > 0 z 0 z -= 1 z 1 r += 2 r 2 o += 1 o 1 print(r) print r r += 2 2 r o = 0 0 o o += 1 1 o z -= 1 1 z r = 0 0 r z = 0 0 z o -= 1 1 o r += 2 2 r z += 1 1 z S = input().strip() input().strip() S
S = input().strip()
z = 0
o = 0
r = 0
for s in S:
    if s == "0":
        if o > 0:
            o -= 1
            r += 2
        else:
            z += 1
    elif s == "1":
        if z > 0:
            z -= 1
            r += 2
        else:
            o += 1
print(r)
