d,a=open(0);r=c=p=0 for x in map(int,a.split()):c=1+c*(x-p==d);r+=c>=r;d=x-p;p=x print(r)