ll N,A[1d5],D[2d6]; { rd(N,A(N)); sortA(N,A); rep(i,N){D[A[i]]++;rep(j,A[i],2d6,A[i])D[j]>?=D[A[i]];} wt(max(D(2d6))); }