#include #include using namespace std; int main(){ string cww; cin >> cww; int len = cww.size(); int count; for(int i = 0; i < len-2; i++){ if(count == 2) break; count = 0; if(cww[i] == 'c'){ for(int j = i+1; j < len-1; j++){ if(cww[j] == 'w'){ count += 1; if(count == 2){ for(int k = 0; k < j ; k++) if(cww[k] == 'c') i = k; cout << j - i + 1 << endl; break; } } } } } if(count != 2) cout << -1 << endl; return 0; }