s=input();n=len(s) cnt=ans=0 for i in range(n-1,-1,-1): if s[i]=='w': cnt+=1 if s[i]=='c': ans+=cnt*(cnt-1)//2 print(ans)