S = list(input())
N = len(S)
a = 0
b = 0
for i in range(N):
  if S[i] == '0':
    a += 1
  else:
    b += 1
m = min(a, b)
ans = 2 * m
print(ans) S = list(input()) S list(input()) list input() input N = len(S) N len(S) len S a = 0 a 0 b = 0 b 0 for i in range(N):
  if S[i] == '0':
    a += 1
  else:
    b += 1 i range(N) range N if S[i] == '0':
    a += 1
  else:
    b += 1 S[i] == '0' S[i] S i '0' a += 1 a 1 b += 1 b 1 m = min(a, b) m min(a, b) min a b ans = 2 * m ans 2 * m 2 m print(ans) print ans b += 1 1 b m = min(a, b) min(a, b) m S = list(input()) list(input()) S a += 1 1 a b = 0 0 b a = 0 0 a ans = 2 * m 2 * m ans N = len(S) len(S) N
S = list(input())
N = len(S)
a = 0
b = 0
for i in range(N):
  if S[i] == '0':
    a += 1
  else:
    b += 1
m = min(a, b)
ans = 2 * m
print(ans)