#include using namespace std; int main(void){ string S; cin >> S; long long ans = 0; long long w = 0; for(unsigned int i = S.length()-1 ;i >= 0;i--){ if(S[i] == 'w') w++; if(S[i] == 'c') ans += w * (w-1) / 2; } cout << ans << endl; return 0; }