#include<bits/stdc++.h> using namespace std; int n,xx,yy,ans=0; int s,x; int main() { cin>>n; cin>>yy; for(int i=1;i<n;i++){ cin>>xx; if(xx>yy) s=max(x+1,s); if(xx<yy) x=max(s+1,x); yy=xx; } cout<<max(s,x)+1; }