// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

//freopen("input.txt", "r", stdin);

//freopen("output.txt", "w", stdout);

 

typedef long long ll;

#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define forr(i, a, b) for(int i = (a); i < (int) (b); i++)

#define forn(i, n) forr(i, 0, n)

#define pb push_back

#define mp make_pair

#define all(c) (c).begin(),(c).end()

#define DBG(x) cerr << #x << " = " << (x) << endl

#define DBGV(v,n) forn(i,n) cout << v[i] << " "; cout << endl

#define esta(x,c) ((c).find(x) != (c).end())

#define RAYA cerr << "===============================" << endl

#define MAXN 2005

#define INF 1000000007



vector <int> divisores(int n)

{

	vector <int> ans;

	forr(i,1,sqrt(n)+1)

	{

		if(n%i == 0) 

		{

			ans.pb(i);

			if(i*i != n) ans.pb(n/i);

		}

		

	}

	sort(all(ans));

	return ans;

}



int main()

{ 

	FIN;

	

	#ifdef input

		//freopen("test1.txt", "r", stdin);

	#endif

	

	vector <int> visto(1000005,0);

	int n;

	cin >> n;

	vector <int> v(n);

	forn(i,n) cin >> v[i];

	forn(i,n) visto[v[i]]++;

	int ans = 0;

	forn(i,n)

	{

		vector <int> div = divisores(v[i]);

		bool d=false;

		visto[v[i]]--;

		for(auto u : div)

		{

			if(visto[u]>0) d=true;

		}

		if(d==true) ans++;

		visto[v[i]]++;

	}

	cout << n-ans << endl;

	return 0;

}


// Optimized solution to the same problem (faster):
#include <iostream>

#include <map>

#include <ctime>

#include <vector>

#include <climits>

#include <algorithm>

#include <random>

#include <cstring>

#include <cstdio>

#include <map>

#include <set>

#include <bitset> 

#include <queue>

#define inf 0x3f3f3f3f

#define IOS ios_base::sync_with_stdio(0); cin.tie(0);

#define rep(i, a, n) for(register int i = a; i <= n; ++ i)

#define per(i, a, n) for(register int i = n; i >= a; -- i)

#define ONLINE_JUDGE

using namespace std;

typedef long long ll;

const int mod=1e9+7;

template<typename T>void write(T x)

{

    if(x<0)

    {

        putchar('-');

        x=-x;

    }

    if(x>9)

    {

        write(x/10);

    }

    putchar(x%10+'0');

}

 

template<typename T> void read(T &x)

{

    x = 0;char ch = getchar();ll f = 1;

    while(!isdigit(ch)){if(ch == '-')f*=-1;ch=getchar();}

    while(isdigit(ch)){x = x*10+ch-48;ch=getchar();}x*=f;

}

ll gcd(ll a,ll b){return b==0?a:gcd(b,a%b);}

ll lcm(ll a,ll b){return a/gcd(a,b)*b;};

ll ksm(ll a,ll n){//¿´ÊÇ·ñÒªmod 

	ll ans=1;

	while(n){

		if(n&1) ans=(ans*a)%mod;

		a=a*a%mod;

		n>>=1;

	}

	return ans%mod;

}

//==============================================================

const int maxn=1e6+10;

int n;

set<int> a;

int mark[maxn];

int vis[maxn];



int main()

{

	#ifndef ONLINE_JUDGE

	freopen("in.txt","r",stdin);

	freopen("out.txt","w",stdout);

	#endif

	//clock_t c1 = clock();

	//===========================================================

    int lim=-inf;

    read(n);

    rep(i,1,n){

        int t;read(t);

        if(a.count(t)) mark[t]++;

        lim=max(lim,t);

        a.insert(t);

    }

    int ans=0;

    for(auto it=a.begin();it!=a.end();++it){

        if(vis[*it]) continue;

        if(!mark[*it]){

            ans++;

        }

        for(int i=1;i*(*it)<=lim;++i){

            vis[i*(*it)]=1;

        }

    }

    write(ans);

	//===========================================================

	//std::cerr << "Time:" << clock() - c1 << "ms" << std::endl;

	return 0;

}

// Fastest known solution for this problem: