#include #include #include #include using namespace std; int main() { string s; cin >> s; vector ans; for(int i = 0;i < s.length();i++){ if(s[i] == 'c'){ int tester = 1; bool flag = false; for(int j = i + 1;j < s.length();j++){ tester++; if(!flag && s[j] == 'w'){ flag = true; } else if(flag && s[j] == 'w'){ break; } } ans.push_back(tester); } } sort(ans.begin(), ans.end(),greater()); if(ans.size() == 0)cout << -1 << endl; else cout << ans[0] << endl; return 0; }