#include #include int main(void) { int l,i; unsigned long long int c=0,cw=0,r=0; char s[131072]; scanf("%s",s); l = strlen(s); for(i = 0;i < l;i++){ if(s[i] == 'c'){c++;} if(s[i] == 'w'){r+=cw;cw+=c;} } printf("%llu\n",r); return 0; }