#define _USE_MATH_DEFINES #include //cin, cout #include //vector #include //sort,min,max,count #include //string #include //fixed #include //setprecision #include //swap #include //abs(int) #include //sqrt #include //stringstream,getline #include //ceil,M_PI using namespace std; int main() { string S; cin >> S; int a = 0, b = 0, c = 0; int ans = -1; if (S.find("c") != string::npos) { a = S.find("c") + 1; if (S.find("w", a) != string::npos) { b = S.find("w", a) + 1;; if (S.find("w", b) != string::npos) { c = S.find("w", b) + 1; ans = c - a + 1; } } } cout << ans << endl; return 0; }