#include using namespace std; #define rep(i,a,b) for(int i=a;i=b;i--) typedef vector vi; int main() { string S; cin >> S; vi w(S.length() + 1, 0); rep(i, 0, S.length()) if (S[i] == 'w') w[i + 1] = 1; rrep(i, S.length() - 1, 0) w[i] += w[i + 1]; int ans = 0; rep(i, 0, S.length()) if (S[i] == 'c') { ans += w[i + 1] * (w[i + 1] - 1) / 2; } cout << ans << endl; }