n,*A=map(int,open(0).read().split());v=x=min(2,n);n-=3 while n:x=max(x,v:=v+1 if(A[n]+A[n+2]-A[n+1]*2)else 2);n-=1 print(x)