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