N=int(input()) A=list(map(int,input().split())) d=.1 c=2 a=1 for x,y in zip(A,A[1:]): if d==y-x:c+=1 else:c,d=2,y-x a=max(a,c) print(a)