import std.algorithm;
import std.range;
import std.stdio;
import std.typecons;
import std.traits;
import std.array;
struct Input
{
  T next(T)()
  {
    import std.conv;
    return to!T(nextWord);
  }
  string nextWord()
  {
    if (_nextWords.empty)
	_nextWords.insertFront(readln().split);
    string word = _nextWords.front; _nextWords.removeFront;
    return word;
  }
  import std.container;
  DList!string _nextWords;
}
Input input;
void read(T...)(ref T args)
{
  import std.traits;
  static foreach(i; 0 .. T.length)
    static if(isArray!(T[i]) && !is(T[i] == string))
      foreach(ref e; args[i])
    	read(e);
    else static if(isTuple!(T[i]))
      static foreach(n; 0 .. T[i].Types.length)
	read(args[i][n]);
    else
      args[i] = input.next!(typeof(args[i]))();
}
auto itup(alias k, alias F)()
{
  alias T = Parameters!F;
  foreach(i; 0 .. k)
    {
      T t; get(t);
      F(t);
    }
}
alias get = read;
void wone(T)(T t, char end)
{
  static if(isArray!T && !is(T == string))
    {
      foreach(i; 0 .. t.length - 1)
	  write(t[i], ' ');
      write(t[$ - 1], end);
    }
  else
      write(t, end);
}
void wr(T...)(T t)
{
  static foreach(i; 0 .. T.length)
    static if(i + 1 < T.length)
      wone(t[i], ' ');
    else
      wone(t[i], '\n');
}
void ans(T...)(T t)
{
  import core.stdc.stdlib;
  wr(t);
  exit(0);
}
void main()
{
  int n; get(n);
  auto a = new int[n]; get(a);
  int[2][] ps;
  int i = 0;
  int res = 0;
  for(; i < n;)
    {
      int si = i, fi = i;
      while(fi + 1 < n && a[fi + 1] > a[fi])
	{
	  fi++;
	}
      ps ~= [si, fi];
      res = max(res, fi - si + 1);
      i = fi + 1;
    }
  for(int j = 1; j < ps.length; j++)
    {
      auto curr = ps[j];
      auto prev = ps[j - 1];
      int comb = 0;
      if (prev[0] < prev[1])
	{
	  if(a[prev[1] - 1] < a[curr[0]])
	    {
	      comb = max(comb, curr[1] - curr[0] + 1 + prev[1] - prev[0]);
	    }
	}
      if (curr[0] < curr[1])
	{
	  if(a[prev[1]] < a[curr[0] + 1])
	    {
	      comb = max(comb, curr[1] - curr[0] + prev[1] - prev[0] + 1);
	    }
	}
      res = max(res, comb);
    }
  ans(res);
}
