#include #include using namespace std; int main(){ int pos_c = 0; string cww = "cww"; string s; cin >> s; if(s.length() < 3){ cout << -1 << endl; return 0; } for(int i=0, j=0; i < s.length(); i++){ if(s[i] == cww[j]){ j++; if(1 == j) pos_c = i; if(3 == j){ cout << i - pos_c + 1 << endl; return 0; } } } cout << -1 << endl; return 0; }