#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); string S; cin >> S; int w = 0; for (auto s : S) { if (s == 'w') w++; } int res = 0; for (auto s : S) { if (s == 'c') { res += w * (w - 1) / 2; } else if (s == 'w') { w--; } } cout << res << '\n'; return 0; }