#include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int main() { string s, t; ll sum1 = 0, cnt = 0; vector v; cin >> s; for (int i = s.size() -1; i >= 0; i--){ if (s[i] == 'c') v.push_back(cnt); if (s[i] == 'w') cnt++; } for (auto x : v){ if (x >= 2) sum1 += x * (x- 1) / 2; } cout << sum1 << endl; }