char s[99999];long m,t,n=1e5;main(){for(gets(s);n--;)s[n]-99?t+=s[n]=='w':(m+=t*~-t/2);m=!printf("%ld",m);}