#include #include #include using namespace std; int main() { string s; cin >> s; float ans = INFINITY; for(int i = 0; i < s.length(); i++){ if(s[i] == 'c'){ int cou = 0; int flag = 0; for(int j = i; j < s.length(); j++){ cou++; if(s[j] == 'w') flag++; if(flag == 2){ if(cou >= 3 && cou < ans) ans = cou; break; } } } } if(ans == INFINITY) cout << -1 << endl; else cout << ans << endl; return 0; }