#include #include #include using namespace std; int main() { string s; cin >> s; int cnt_w = count(s.begin(), s.end(), 'w'); int ans = 0; for (char c: s) { if (c == 'c') { ans += cnt_w * (cnt_w - 1) / 2; } else if (c == 'w') { cnt_w--; } } cout << ans << endl; return 0; }