#include #define REP(i,n) for(int i=0;i<(int)(n);i++) #define ALL(x) (x).begin(),(x).end() using namespace std; typedef long long ll; typedef long double ld; const ld eps = 1e-9, pi = acos(-1.0); ll dp[3]; int main() { string str; cin >> str; for (char c: str) { if (c == 'c') dp[0]++; else if (c == 'w') { dp[2] += dp[1]; dp[1] += dp[0]; } } cout << dp[2] << endl; return 0; }