#include<stdio.h>
#include<algorithm>
using namespace std;
#define int long long
const int n=1e5+5;
int a,b[n],c[n],d[n],an=0;
signed main()
{
scanf("%lld",&a);
for(int i=1;i<=a;i++)
scanf("%lld",&b[i]);
b[a+1]=0x3f3f3f3f;
for(int i=1;i<=a;i++)
{
c[i]=1;
if(b[i]>b[i-1]) c[i]=c[i-1]+1;
an=max(c[i],an);
}
for(int i=a;i>=1;i--)
{
d[i]=1;
if(b[i+1]>b[i]) d[i]=d[i+1]+1;
an=max(d[i],an);
}
for(int i=1;i<=a;i++)
{
if(b[i-1]+1<b[i+1]) an=max(an,d[i+1]+c[i-1]+1);
}
printf("%lld\n",an);
}
#include<algorithm>
using namespace std;
#define int long long
const int n=1e5+5;
int a,b[n],c[n],d[n],an=0;
signed main()
{
scanf("%lld",&a);
for(int i=1;i<=a;i++)
scanf("%lld",&b[i]);
b[a+1]=0x3f3f3f3f;
for(int i=1;i<=a;i++)
{
c[i]=1;
if(b[i]>b[i-1]) c[i]=c[i-1]+1;
an=max(c[i],an);
}
for(int i=a;i>=1;i--)
{
d[i]=1;
if(b[i+1]>b[i]) d[i]=d[i+1]+1;
an=max(d[i],an);
}
for(int i=1;i<=a;i++)
{
if(b[i-1]+1<b[i+1]) an=max(an,d[i+1]+c[i-1]+1);
}
printf("%lld\n",an);
}