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