s=input() n=len(s) a=0 c=0 i=n-1 while i>0: if s[i]=="0": c+=1 i-=1 elif s[i]=="1": if s[i-1]=="1": a+=c i-=2 else: i-=1 print(a)