#include using namespace std; int main(){ string S; cin >> S; int wcnt = 0, cstate = -1; for(int i = 0; i < S.size(); ++i){ if(S[i] == 'c') cstate = i; if(cstate != -1&&S[i] == 'w'){ ++wcnt; } if(wcnt == 2){ cout << i - cstate + 1 << endl; exit(0); } } cout << -1 << endl; }