#include using namespace std; typedef long long ll; #define rep(i,n) for(i=0;i>s; ll w=0; ll ans=0; for(int i=s.size()-1; i>=0; --i){ if(s[i]=='w') ++w; else if(s[i]=='c') ans+=w*(w-1)/2; } std::cout << ans << std::endl; return 0; }