s = input()
ls = list(map(int,list(s)))
lt = []
for i in range(len(s)-1):
  lt.append(ls[i]+ls[i+1])

ans = 0
while 1 in lt:
  flg = 1
  n = len(ls)
  for i in range(1,n):
    if flg == 1 and lt[n-i-1] == 1:
      ls.pop(n-i)
      ls.pop(n-i-1)
      ans += 2
      flg = 0
    elif flg == 0:
      flg = 1
  lt = []
  for i in range(len(ls)-1):
  	lt.append(ls[i]+ls[i+1])
print(ans)