N,*A=map(int,open(0).read().split());d=.1;c=2;a=1 for x,y in zip(A,A[1:]): if d-y+x:c=1;d=y-x a=max(a,c:=c+1) print(a)