#include<iostream>
using namespace std;
long long N=0, br=0, lokmax1=0, lokmax2=0;
int main(){

cin>>N;
long long chislo[N];

for(int i=0; i<N; i++){
    cin>>chislo[i];
}

for(int i=1; i<N-1 && br<2; i++){
    if(chislo[i]>chislo[i+1] && chislo[i]>chislo[i-1]){
        if(br==0){
            lokmax1=i;
            br++;
        }else{
            lokmax2=i;
            break;
        }
    }
}

cout<<(lokmax1+1)-(lokmax2-1)+1<<endl;

return 0;
}
