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