R=range I=input N=int(I()) A=list(map(int,I().split())) print(max(min(j-i+1for j in R(i,N)if j==N-1or A[j]+A[i+1]!=A[i]+A[j+1])for i in R(N)))