#include #define REP(i,n) for(int i=0; i<(n); i++) #define REP2(i,x,n) for(int i=x; i<(n); i++) using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); string S; cin >> S; int count{}; REP( i, (int)S.size() ) { if( S[i] == 'c' ) { REP2( j, i + 1, (int)S.size() ) { REP2( k, j, (int)S.size() ) { if( S[j] == 'w' && S[k] == 'w' && j != k ) { count++; } } } } } cout << count << endl; return 0; }