#include using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define repi(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define all(x) (x).begin(),(x).end() #define foreach(u,v) for(auto (u) : (v)) #define pb push_back #define mp make_pair #define mt make_tuple typedef long long ll; typedef pair pii; typedef vector vi; typedef vector vvi; typedef pair pll; typedef vector vl; const int inf = 1e9; const ll linf = 1LL<<60; const ll mod = 1e9 + 7; const double eps = 1e-9; /* */ ll power(ll b, ll p) { if(p == 0) return 1; return power(b*b%mod, p/2) * (p%2 ? b : 1) % mod; } vl fac(100001), finv(100001); ll comb(ll n, ll r) { return fac[n]*finv[n-r]%mod*finv[r]%mod; } int main() { fac[0] = fac[1] = 1; repi(i, 2, 100001) fac[i] = fac[i-1] * i % mod; finv[100000] = power(fac[100000], mod-2); for(int i = 100000; i > 0; i--) finv[i-1] = finv[i] * i % mod; string s; cin >> s; int n = s.size(); vi cnt(n, 0); for(int i = n-1; i > 0; i--){ cnt[i-1] += cnt[i] + (s[i] == 'w'); } ll ans = 0; rep(i, n){ if(s[i] == 'c' and cnt[i] >= 2){ ans += comb(cnt[i], 2); } } cout << ans << endl; return 0; }