S = list(input())
A = 0
B = 0
for s in S:
    if s == '0':
        A += 1
    else:
        B += 1
print(min(A,B)*2) S = list(input()) S list(input()) list input() input A = 0 A 0 B = 0 B 0 for s in S:
    if s == '0':
        A += 1
    else:
        B += 1 s S if s == '0':
        A += 1
    else:
        B += 1 s == '0' s '0' A += 1 A 1 B += 1 B 1 print(min(A,B)*2) print min(A,B)*2 min(A,B) min A B 2 S = list(input()) list(input()) S B = 0 0 B A = 0 0 A A += 1 1 A B += 1 1 B
S = list(input())
A = 0
B = 0
for s in S:
    if s == '0':
        A += 1
    else:
        B += 1
print(min(A,B)*2)