//
//$$$$$$$$$$$$$$$$$$$$$$
//$$                  $$
//$$   gyoubu_oniwa   $$
//$$                  $$
//$$$$$$$$$$$$$$$$$$$$$$
//
#include<bits/stdc++.h>
using namespace std;
#define DBG(a) cout<<#a<<':'<<a<<endl;
#define PB push_back
#define EB emplace_back
#define btoe(v) (v).begin(),(v).end()
#define F first
#define S second
#define L length()
#define SZ size()
#define pow(a,b) (pow(a,b)+0.5)

typedef unsigned long long int ulli;
typedef long long int lli;
typedef long double ldbl;
#define f(i,a,b) for(int i=(a); i<(b); ++i)
#define fr(i,a,b) for(int i=(a); i>(b); --i)
#define fl(i,a,b) for(lli i=(a); i<(b); ++i)
#define flr(i,a,b) for(lli i=(a); i>(b); --i)
#define w(x) lli x; cin>>x; while(x--) 
#define inpn(n,v,T) T n; cin>>n; vector<T> v(n); fl(i,0,n) cin>>v[i];
#define inp(n,v,T) vector<T> v(n); fl(i,0,n) cin>>v[i];

typedef pair<int,int> pii;typedef vector<int> vi;typedef vector<vi> vvi;typedef vector<pii> vpii;typedef vector<vector<pii>> vvpii;typedef pair<lli,lli> plli;typedef vector<lli> vlli;typedef vector<vlli> vvlli;typedef vector<plli> vplli;typedef vector<vector<plli>> vvplli;typedef vector<bool> vb;typedef vector<string> vs;typedef vector<vector<string>> vvs;

#define unmp unordered_map

#define PRIME ((lli)(1e9+7ll))
#define PRIME2 (998244353ll)
const lli TEN_18 = 1e18;
const lli TEN_9 = 1e9;
const lli TEN_5 = 1e5;

inline void debugORfast(int a=1,int b=1){
    if(a){
        #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
        #endif
    }
    if(b){ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
}}

template<typename T>
void print(const T &v, int begin=-1, int end=-1, int w=2)
{
	if(begin==-1) fl(i,0,v.SZ) cout<<setw(w)<<v[i]<<' ';
	else if(end==-1) fl(i,begin,v.SZ) cout<<setw(w)<<v[i]<<' ';
	else fl(i,begin,end) cout<<setw(w)<<v[i]<<' ';
	cout<<endl;
}

template<typename T>
void printr(const T &v, int begin=-1, int end=-1, int w=2)
{
	if(begin==-1) flr(i,v.SZ-1,-1) cout<<setw(w)<<v[i]<<' ';
	else if(end==-1) flr(i,begin,-1) cout<<setw(w)<<v[i]<<' ';
	else flr(i,begin,end) cout<<setw(w)<<v[i]<<' ';
    cout<<endl;
}

void pans(char v){
	switch(v){
		case 'y' : cout<<"yes"<<endl; break;
		case 'n' : cout<<"no"<<endl; break;
		case 't' : cout<<"True"<<endl; break;
		case 'f' : cout<<"False"<<endl; break;
		case 'Y' : cout<<"Yes"<<endl; break;
		case 'N' : cout<<"No"<<endl; break;
	}
}


ulli gcd(ulli a, ulli b)
{
    //Time - O(Lg min(a,b))
    //Consecutive fibonacci are worst inputs
    //DONT pass negative arguments
    while(b)
    {
        a%=b;
        swap(a,b);
    }
    return a;
}

ulli gcd(ulli a, ulli b, lli & x, lli & y)
{
    //a.x + b.y = gcd
    //Note x and y can be negative, but not a and b
    if (a == 0) {
        x = 0;
        y = 1;
        return b;
    }
    lli x1, y1;
    ulli d = gcd(b % a, a, x1, y1);
    x = y1 - (b / a) * x1;
    y = x1;
    return d;
}

ulli mmi(ulli a, ulli m)
{
    lli x,y;
    ulli g = gcd(a,m,x,y);
    if(g!=1)   //gcd(a,m) must be 1 for MMI to exist
    {
        return -1;
        //signifies no mmi exists
    }
    //to make x within m and positive both
    if(x<0) return x+m;
    else return x;


    ////THE CORRECT WAY TO GIVE ANSWER FOR WHEN FRACTION a/b is to be
    ////reported as  (a*b^-1)moduloPRIME
    //int a,b; cin>>a>>b;
    //cout<<(((ulli)a)*mmi(b,PRIME2))%PRIME2<<endl;
}

ulli lcm(ulli a, ulli b)
{
    return a/gcd(a,b)*b;   //No need of float in division
}

template<typename T>
T binpow(T a, T b) {
    T res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

template<typename T>
T binpow(T a, T b, T m) {
    a %= m;
    T res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a) % m;
        a = (a * a) % m;
        b >>= 1;
    }
    return res;
}

template<typename T>
T binpow(T a, T b, pair<T,bool> isprime) {
    T m = isprime.F;
    if(isprime.S==true) b %= (m-1);
    a %= m;
    T res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a) % m;
        a = (a * a) % m;
        b >>= 1;
    }
    return res;
}


plli fib(lli n) {
    //O(logn)
    //Using prop -> F(2k) = F(k) * (2*F(k+1) - F(k))
    //and F(2k+1) = F(k+1)*F(k+1) + F(k)*F(k)
    //F(k) means kTh Fib num
    if (n == 0)
        return {0, 1};

    plli p = fib(n >> 1);
    lli c = p.first * (2 * p.second - p.first);
    lli d = p.first * p.first + p.second * p.second;
    if (n & 1)
        return {d, c + d};
    else
        return {c, d};
}

#define LPF_LIMIT (TEN_5)   // (10^7)-(0.1sec), (10^8)-(1.5sec)
vi lpf;   
void leastPrimeFactorVector()
{
    lpf.resize(LPF_LIMIT);
    lpf[0] = 0;
    lpf[1] = 1; //take care to not forget this
    fl(i,2,LPF_LIMIT+2)
    {
        if(lpf[i] == 0)
        {
            lpf[i] = i;
            for(lli j=2*i; j<=LPF_LIMIT; j+=i)
            {
                if(lpf[j]==0) lpf[j]=i;
            }
        }
    }
}

#define ERATOS_LIMIT 32000  //32000^2 > 10^9
#define ERATOS_LIMIT_BIG 1000002 //1000002^2 > 10^12
vector<char> sieveEratos(ulli n = ERATOS_LIMIT_BIG)
{
    // n/(ln(n)-1.1) gives upperbound to number of primes less than n
    // use is_prime like this
    // if((bool)is_prime(num)) cout<<num<<" is prime"<<endl;
    
    vector<char> is_prime(n+1, true);
    is_prime[0] = is_prime[1] = false;
    for (int i = 2; i * i <= n; i++) {
        if (is_prime[i]) {
            for (int j = i * i; j <= n; j += i)
                is_prime[j] = false;
        }
    }
    return is_prime;

    // use is_prime like this
    // if((bool)is_prime(num)) cout<<num<<" is prime"<<endl;
}

int ceilLog2(ulli x)
{
    static const unsigned long long t[6] = {
        0xFFFFFFFF00000000ull,
        0x00000000FFFF0000ull,
        0x000000000000FF00ull,
        0x00000000000000F0ull,
        0x000000000000000Cull,
        0x0000000000000002ull
    };
    int y = (((x & (x - 1)) == 0) ? 0 : 1);
    int j = 32;
    int i;
    for (i = 0; i < 6; i++) {
        int k = (((x & t[i]) == 0) ? 0 : j);
        y += k;
        x >>= k;
        j >>= 1;
    }
    return y;
}

unsigned int floorLog2(ulli val) {
    if (val == 0) return UINT_MAX;
    if (val == 1) return 0;
    unsigned int ret = 0;
    while (val > 1) {
        val >>= 1;
        ret++;
    }
    return ret;
}

ulli countSetBits(ulli val)
{
    int co = 0;
    while(val)
    {
        ++co;
        val = val&(val-1);
    }
    return co;
}

vi* factorialModulo(lli lim = 10000, lli m = PRIME)
{
    vi* facmod = new vi(lim+1);
    facmod->at(0) = 1;
    fl(i,1,lim+1)
    {
        facmod->at(i) = (facmod->at(i-1)*i)%m;
    }
    return facmod;
}

lli bincoeffm(lli n, lli k, vi* facmodd, lli m = PRIME)
{
    //call factorialModulo before this for precomputation
    vi &facmod = *facmodd;
    assert(facmod.SZ >n);
    return (((facmod[n]*mmi(facmod[k],m))%m)*(mmi(facmod[n-k],m)))%m;
}



lli tmp1,tmp2;

int main()
{
	debugORfast(0,1);
	const int DBGDO=100;
	//w(ttt)
	{
		inpn(n,a,int);
		sort(btoe(a));

		unmp<int,int> count;
		f(i,0,n){
			count[a[i]] ++; }

		if(a[0]==1){
			if(count[1] > 1)
				cout<<0<<endl;
			else 
				cout<<1<<endl;
			return 0;
		}

		//print(a);
		int ans=0;
		f(i,0,n){
			if(count[a[i]] > 1) continue;

			bool cnt = true;

			f(d,1,sqrt(a[i])+1){

				if(a[i]%d != 0) continue;

				int num1 = d;
				int num2 = a[i]/d;

				if(num2==1) break;

				//DBG(num1); DBG(num2);

				auto lb1 = lower_bound(btoe(a),num1);
				auto lb2 = lower_bound(btoe(a),num2);

				//DBG(*lb1); DBG(*lb2);

				if((lb1 != a.end() and *lb1 == num1) or 
					(lb2 != a.end() and *lb2 == num2)){
					if(d==1 and (lb2-a.begin())!=i){
						cnt=false;
						break;
					}else if(d!=1){
						cnt=false;
						break;
					}
				}
			}
			//DBG(cnt);
			if(cnt) ans++;
		}
		cout<<ans<<endl;
	}

	return 0;
}


Measured memory_bytes: 12124