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