n=int(input()) b=list(map(int,input().split())) cot=1 m=0 c=1 for i in range(1,n): if b[i]-1==b[i-1]: cot=cot+1 if cot==n: m=n else: if cot>m and cot>1: m=cot cot=1 if m>1: print(m) else: print(c)