#include using namespace std; using ll=long long; #define rep(i,n) for(int i=0;i<(int)(n);++i) #define rrep(i,m) for(int i=(int)(m)-1;i>=0;--i) #define debug(x) cout << #x << "=" << (x) << endl; template inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;} template inline bool chmax(T& a,T b){if(a void fail(T v){cout << v << endl;exit(0);} //template end void solve(){ string s; cin>>s; vector ct(s.size()+1); rrep(i,s.size())ct[i]=ct[i+1]+(s[i]=='w'); ll res=0; rep(i,s.size()) if(s[i]=='c')res+=(ll)ct[i]*(ct[i]-1)/2; cout<