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
  lf = [1]*len(ls)
  for i in range(len(lt)):
    if flg == 1 and lt[i] == 1:
      lf[i] = 0
      lf[i+1] = 0
      ans += 2
      flg = 0
    elif flg == 0:
      flg = 1
  ls = [ls[i] for i,f in enumerate(lf) if f>0]
  lt = []
  for i in range(len(ls)-1):
  	lt.append(ls[i]+ls[i+1])

print(ans)