// yukicoder 345 (http://yukicoder.me/problems/984) #include #include #define rep(i,a) for(int i=0;i<(a);++i) const std::string cww = "cww"; std::string S; int main() { std::cin >> S; int cnt = 0, s; rep( i, S.size() ) { if( S[i] == cww[cnt] ) { if( !cnt ) s = i; ++cnt; } if( cnt == 3 ) { printf( "%d\n", i-s+1 ); return 0; } } puts("-1"); return 0; }