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