s = input()
n = len(s)
m = 0
for x in s:
  m += int(x)
print(n-abs(n-2*m)) s = input() s input() input n = len(s) n len(s) len s m = 0 m 0 for x in s:
  m += int(x) x s m += int(x) m int(x) int x print(n-abs(n-2*m)) print n-abs(n-2*m) n abs(n-2*m) abs n-2*m n 2*m 2 m m += int(x) int(x) m m = 0 0 m n = len(s) len(s) n s = input() input() s
s = input()
n = len(s)
m = 0
for x in s:
  m += int(x)
print(n-abs(n-2*m))