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