#include using namespace std; typedef long long ll; typedef vector VI; typedef vector VVI; typedef vector VL; typedef vector VVL; typedef pair PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #define MOD 1000000007 #define INF (1LL<<25) //33554432 #define PI 3.14159265359 #define EPS 1e-12 #define int ll int t[100010]; signed main(void) { string s; cin >> s; const int n = s.size(); int a = 0; for(int i=n-1; i>=0; --i) { if(s[i] == 'w') a++; if(s[i] == 'c') t[i] = a; } ll ret = 0; REP(i, n) { // (t[i]) C (2) ret += t[i]*(t[i]-1)/2; } cout << ret << endl; return 0; }