s=list(input()) ans=0;c=0;s+=["0"];s.reverse() for i in range(1,len(s)): if s[i]=="0": c+=1 elif s[i-1]=="1": ans+=c s[i]="0" print(ans)