#include using namespace std; int main(){ string s; int i{0},no{0}; vector vc; while(cin>>s[i]){ vc.push_back(s[i]); if(s[i]=='w'){no = i;} s+=s[i]; i++; } transform(s.begin(), s.end(), s.begin(), ::tolower); string::size_type index1 = s.find_first_of('c'); string::size_type index2 = s.find_first_of('w',index1); index2 = index2+1; string::size_type index3 = s.find_first_of('w',index2); index2 = index2-1; if(index1==string::npos||index2==string::npos||index3==string::npos){ cout << -1 << endl; return 0; } int res = no-index1+1; cout << (index1