#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; int dp[1000005]; int main(){ ios::sync_with_stdio(false); int N; cin >> N; vector x; rep(i,N){ int a; cin >> a; x.push_back(a); } sort(ALLOF(x)); int ret = 0; rep(i,x.size()){ int y = x[i]; int j = 1; while(y/j > 0){ dp[x[i]] = max(dp[x[i]], dp[y/j]+1); j++; } ret = max(ret, dp[x[i]]); } cout << ret << endl; return 0; }