#include using namespace std; int main() { string s; int result = -1; cin >> s; for (int i = 0; i < s.length(); i++) { if (s[i] == 'c') { for (int j = i+1; j < s.length(); j++) { if (s[j] == 'w') { for (int k = j+1; k < s.length(); k++) { if (s[k] == 'w') result = k - i + 1; } } } } } cout << result << endl; return 0; }