#include #include using lint = long long; void solve() { std::string s; std::cin >> s; lint x = 0, y = 0, ans = 0; for (char c : s) { if (c == 'c') ++x; if (c == 'w') { ans += y; y += x; } } std::cout << ans << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }