#include #include #include using namespace std; #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define FORR(i,a,b) for (int i=(b)-1;i>=(a);i--) #define REP(i,n) for (int i=0;i<(n);i++) #define RREP(i,n) for (int i=(n)-1;i>=0;i--) #define pb push_back #define ALL(a) (a).begin(),(a).end() typedef long long ll; int main() { string S; cin >> S; ll N = S.length(); ll sm = 0; REP(i, N) { if (S[i] == 'c') { ll w = 0; FOR(j, i+1, N) { if (S[j] == 'w') { w++; } } sm += w * (w - 1) / 2; } } cout << sm << endl; return 0; }