s=input() o=ans=0 k=0 for c in s: if c=='1': o+=1 else: ans+=k+o//2 k+=o//2 o=0 print(ans)