l,ans=0,0 for i in input(): if int(i): l+=1 else: ans+=l>>1 l-=l%2 print(ans)