char s[100010]; long m,t,n; main(){ n=strlen(gets(s)); for(;n--;)if(s[n]=='c')m+=t*(t-1)/2;else if(s[n]=='w')t++; n=!printf("%ld",m); }