s=input();w=a=0 for i,c in enumerate(s): if c<'1':a+=(i-w)//2;w+=1+(i-w)%2 print(a)