#include using namespace std; #define ALL(x) x.begin(),x.end() #define rep(i,n) for(int i=0;i<(n);i++) #define debug(v) cout<<#v<<":";for(auto x:v){cout<bool chmax(T &a,const T &b){if(abool chmin(T &a,const T &b){if(b ostream &operator<<(ostream &os,const pair&p){ os< ostream &operator<<(ostream &os,const vector&v){ for(int i=0;i<(int)v.size();i++) os< istream &operator>>(istream &is,pair&p){ is>>p.first>>p.second; return is; } template istream &operator>>(istream &is,vector&v){ for(T &x:v)is>>x; return is; } int solve(vector a){ int n=(int)a.size(); vector l(n); { stack st; rep(i,n){ while(!st.empty() and st.top()>=a[i]) st.pop(); st.push(a[i]); l[i]=(int)st.size(); } } vector r(n); { stack st; for(int i=n-1;i>=0;i--){ while(!st.empty() and st.top()>=a[i]) st.pop(); st.push(a[i]); r[i]=(int)st.size(); } } int ans=0; rep(i,n){ chmax(ans,min(l[i],r[i])-1); } return ans; } signed main(){ int n;cin>>n; vector a(n); cin>>a; vector b(n); rep(i,n)b[i]=-a[i]; cout<