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