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