#include #include #include using namespace std; int main() { string s; cin >> s; long long ans = 0; for (int i = 0; i < s.size(); i++) { if (s[i] != 'c') { continue; } long long nw = count(s.begin() + i, s.end(), 'w'); ans += nw * (nw - 1) / 2; } cout << ans << endl; return 0; }