N,*A=map(int,open(0).read().split()) v,x=1,1 for i in range(1,N): if i^1 and A[i]+A[i-2]==A[i-1]*2: v+=1 else: v=2 x=max(x,v) print(x)