#import int N,A[2000],a=1,i,j,t;main(){for(std::cin>>N;std::cin>>A[i];i++){for(j=i;j&&A[j-1]+A[i]==A[i-1]+A[j];j--)a<(t=i-j+2)?a=t:a;}std::cout<