#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; bool flag; for (int l = 0; l < S.size(); l++) { if (S[l] == 'c') { flag = false; for (int m = l + 1; m < S.size() - 2; m++) { if (S[m] == 'w' && !flag) { for (int r = m+1; r < S.size(); r++) { if (S[r] == 'w') { ans = max(ans, r-l+1); flag = true; break; } } } } } } if (ans == 0) cout << -1 << endl; else cout << ans << endl; return 0; }