#include typedef long long ll; using namespace std; int INF = 1LL << 30; int MOD = 1e9+7; main(){ string S; cin >> S; ll cnt = 0,ans = 0; reverse(S.begin(),S.end()); for(auto c:S){ if(c == 'c' && cnt) ans += cnt * (cnt-1) / 2; else if(c == 'w') cnt++; } cout << ans << endl; }