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