#include #include #include typedef unsigned long long ul; typedef signed long long ll; int main(void) { std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(2); std::string s; std::cin >> s; ll w = 0; ll ans = 0; for (ll i = s.size()-1; i >= 0; --i) { if (s[i] == 'w') w++; if (s[i] == 'c') ans += w * (w-1) / 2; } std::cout << ans << std::endl; return 0; }