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