void main(){
  import std.stdio, std.string, std.conv, std.algorithm;

  int n; rd(n);
  auto a=new int[](n);
  foreach(i; 0..n) rd(a[i]);

  auto dp=new int[](n);
  dp[0]=1;
  bool up=true;
  foreach(i; 1..n){
    if(up){
      if(a[i-1]<a[i]) dp[i]=dp[i-1]+1;
      else if(a[i-1]==a[i]) dp[i]=dp[i-1];
      else dp[i]=2, up=false;
    }else{
      if(a[i-1]>a[i]) dp[i]=dp[i-1]+1;
      else if(a[i-1]==a[i]) dp[i]=dp[i-1];
      else dp[i]=2, up=true;
    }
  }

  writeln(reduce!(max)(dp));

}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}