#include #include #include using namespace std; int main() { string s; cin >> s; auto cit = find(s.begin(), s.end(),'c'); int ans = 0; while (true) { int wcnt = count(cit, s.end(), 'w'); if (wcnt != 0) { ans += (wcnt*(wcnt - 1) / 2); cit = find(cit + 1, s.end(), 'c'); } else { break; } } cout << ans << endl; return 0; }