//#include<bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <sys/types.h>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include<bitset>
#include<fstream>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define pii pair<int, int>
#define pll pair<ll, ll>
#define all(x) x.begin(), x.end()
#define rep(a, b, c) for (int a = b; a < c; a++)
#define pb push_back
#define fi first
#define se second
#define INF 1000000000000000000
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
# define M_PI 3.14159265358979323846
const int maxx = 10000002;
const int mod2 = 987654319;
const int maxlog = 20;
const ll mod = 1000000007;
const int mod3 = 998244353;

ll power(ll x, ll y) {
    ll res = 1;
    while (y) {
        if (y & 1) res = (res * x) % mod; 
        y >>= 1;
        x = (x * x) % mod;
    }
    return res;
}


void solve(int test) {
    int N;
    cin >> N;
    vector<int> a(N);
    map<int, int> mp;
    rep(i, 0, N) {
        int x; cin >> x;
        a[i] = x;
        mp[x]++;
    } 
    int ans = 0;
    rep(i, 0, N) {
        int ok = 1;
        for (int j = 2; j * j <= a[i]; j++) {
            if (a[i] % j == 0) {
                int t = a[i] / j;
                if (mp.count(t) || mp.count(j)) {
                    ok = 0;
                    break;
                }
            }
        }
        if (mp[a[i]] > 1 || mp.count(1)) ok = 0;
        ans += ok;
    }
    cout << ans;
}


int main() {
    IOS
    ifstream ifs;
    ofstream ofs;
    ifs.open("input.txt");
    ofs.open("output.txt");
    //make();
    int tt = 1, test = 1;
    //cin >> tt;
    while (tt--) {
        solve(test);
        test++;
    }
}
