#include #include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); string S; cin >> S; int64_t ans = 0; for (int32_t i = S.size() - 1, count = 0; i != -1; --i) switch (S[i]) { case 'w': ++count; break; case 'c': ans += count * static_cast(count - 1) / 2; break; } cout << ans << '\n'; return 0; }