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