#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { string S; cin >> S; int ans = 0, sta = 0; for (int l = 0; l < S.size(); l++) { if (S[l] == 'c') { for (int r = S.size(); r >= l+1; r--) { if (S[r] == 'w') { for (int m = l+1; m < r; m++) { if (S[m] == 'w') { ans = max(ans, r-l+1); break; } } } } } } if (ans == 0) cout << -1 << endl; else cout << ans << endl; return 0; }