S=list(input()) i=0 while i1: St=len(Co) if len(Co)%2==1: St-=1 Nw=0 if Co[St-1]==1: Nw+=1 St-=2 while St>1: Nw+=Co[St-1] Nw1=Nw-1 Nw1*=Nw Nw1//=2 Sc+=Nw*Co[St-2] St-=2 print (Sc)