#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)s; i < (int)e; ++i) #define all(a) (a).begin(), (a).end() int main() { cin.tie(nullptr); string S; cin >> S; int siz = S.size(); vector dp(3, 0); rep(i, 0, siz) { if (S[i] == 'c') dp[0]++; if (S[i] == 'w') { dp[2] += dp[1]; dp[1] += dp[0]; } } cout << dp[2] << '\n'; }