// Slower C++ solution:
#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 30005

#define INF 1000000007



vector <int> divisores(int n)

{

	vector <int> ans;

	for(int i=1; i<sqrt(n)+1; i++)

	{

		if(n%i==0)

		{

			ans.push_back(i); // n/i tambien es divisor y es mayor a raiz de n 

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

		}

	}

	

	sort(ans.begin(),ans.end());

	//(reverse(ans.begin(),ans.end());

	return ans;

}





int main()

{ 

	FIN;

	

	#ifdef input

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

	#endif

	

	int n;

	cin >> n;

	vector <int> v(n);

	for(int i=0; i<n; i++) cin >> v[i];

	

	vector <int> cont(1000005,0);

	

	for(int i=0; i<n; i++)

	{

		cont[v[i]]++;

	}

	

	int ans=0;

	

	//O(n^2) 4*10^10 operaciones

	//O(n*(n+1)/2) --> O(n^2)

	

	//O(n*sqrt(MAXN)) --> 2*10^5*10^3 = 2*10^8 

	

	for(int i=0; i<n; i++)

	{

		bool d = true;

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

		//for(auto u : div) cout << u << " "; cout << endl;

		for(int j=0; j<div.size(); j++)

		{

			if(div[j]==v[i]) 

			{

				if(cont[div[j]]>1)

				{

					d=false;

				}

				continue;

			}

			if(cont[div[j]]>0) d=false;

		}

		if(d==true) ans++;

	}

	

	cout << ans << endl;

	

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.111082120342628x):
#include <iostream>



#include <deque>



#include <stdio.h>



#include <cstdio>



#include <algorithm>



#include<bits/stdc++.h>



#define pub push_back

#define puf push_front

#define pob pop_back

#define pof pop_front

#define sp <<" "

#define nw <<"\n"

#define ca "Case "<<tc++<<": "

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

#define ull unsigned LL

#define check cout<<"* ";

#define show_vector for(int q=0;q<v.size();q++){cout<<v[q]<<" ";}

#define REP(i,n) for (int i=0;i<(n);++i)

#define N_MAX 26



const int inf=1<<30;

const long long int INF=1e10;

const int MOD=1e9+7;

const int maxn = 1e5+10;

int a[200005],b[1000005];



using namespace std;



typedef long long ll;

typedef pair<int, int> pii;



int is_prime(int n)

{

    int coun;

     coun=0;

     if(n>1){

      for(int i=2;i*i<=n;i++){

        if( n%i==0 ){

            coun++;

          }

        }

      }

     if(n==1){

       coun=coun;

         }

    if(coun==0){

        return 1;

        }

    return 0;

}



int main()

{

    int n;

    vector<long long int>v;

    int cnt=0;

    cin>>n;



    for(int i=1;i<=n;i++){

        int z;

        cin>>z;

        //if(is_prime(z)==1){

        //    cnt++;

        //    continue;

        //}

        v.pub(z);

    }

    sort(v.begin(),v.end());



    int m=v.size();

    for(int i=0;i<m;i++)

	{

	    int r=2;

		for(int j=v[i];j<=v[m-1];j+=v[i])

		{

		    //cout<<j sp<<v[i] sp<<b[j] sp sp;

			b[j]++;

			//cout<<j sp<<v[i] sp<<b[j] nw;

		}

	}

	for(int i=0;i<m;i++)

	{

	    //cout<<b[v[i]] sp;

		if(b[v[i]]==1)

		cnt++;

	}

	cout<<cnt nw;

}