#include using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < n; ++i) #define P pair #define Graph vector> #define fi first #define se second #define vvvvll vector>>> #define vvvll vector>> #define vvll vector> #define vll vector #define pqll priority_queue #define pqllg priority_queue, greater> constexpr ll INF = (1ll << 60); constexpr ll mod = 1000000007; // constexpr ll mod = 998244353; // constexpr ll mod = 67280421310721; constexpr double pi = 3.14159265358979323846; template inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } void pt_vvll(vvll v) { ll vs = v.size(), vs0 = v[0].size(); rep(i, vs) { rep(j, vs0) { cout << v[i][j]; if (j != vs0 - 1) cout << " "; else cout << "\n"; } } } void pt_vll(vll v) { ll vs = v.size(); rep(i, vs) { cout << v[i]; if (i == vs - 1) cout << "\n"; else cout << " "; } } vector divisor(ll n, vll &ret) { for (ll i = 1; i * i <= n; i++) { if (n % i == 0) { ret.push_back(i); if (i * i != n) ret.push_back(n / i); } } return ret; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll N; cin >> N; vll x(N); vector exs(1000010); rep(i, N) { cin >> x[i]; exs[x[i]] = true; } vector saw(1000010, false); ll ans = 1; for (ll i = 2; i < 1000010; i++) { if (saw[i]) continue; if (exs[i] == false) continue; ll now = i; ll sum = 0; for (ll j = now; j < 1000010; j += now) { if (exs[j]) { now = j; sum++; } saw[j] = true; } chmax(ans, sum); } if (exs[1] == true) ans++; cout << ans << "\n"; return 0; }