s=input() f=0 stc=0 ans=0 for i in s: if i=="1": if f==0: f=1 else: stc+=1 f=0 else: f=0 ans+=stc print(ans)