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