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