#include #include #include using namespace std; int main() { string s; cin >> s; vector dp(3); for (char c: s) { if (c == 'c') dp[0]++; if (c == 'w') dp[2] += dp[1], dp[1] += dp[0]; } cout << dp[2] << endl; return 0; }