s = input()
c = 0
for i in s:
  if i == '0':
    break
  c += 1
r = list(range(len(s)))
r.reverse()
d = 0
for i in r:
  if s[i] == '1':
    break
  d += 1
zero = 0
one = 0
for i in range(c, len(s) - d):
  if s[i] == '0':
    zero += 1
  else:
    one += 1
print(min(zero, one) * 2)