#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define lli long long int
#define ulli unsigned long long int
#define ldb long double
#define pb push_back
#define popb pop_back
#define ins insert
#define si size()
#define sof sizeof()
#define be begin()
#define en end()
#define all(v) v.be,v.en
#define le length()
#define mp make_pair
#define mt make_tuple
#define G(a,b) get<a>(b)
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define ump unordered_map
#define forr(i,a,n) for(lli i=a;i<n;i++)
#define rfor(i,n,a) for(lli i=n;i>=a;i--)
#define fore(i,a,n) for(lli i=a;i<=n;i++)
#define maxe *max_element
#define mine *min_element
#define JaiHindDosto ios::sync_with_stdio(0), cin.tie(0),cout.tie(0)
#define nl cout<<endl;
#define o(a) cout<<a<<" "
#define o1(a) cout<<a<<"\n"
#define o2(a,b) cout<<a<<" "<<b<<"\n"
#define o3(a,b,c) cout<<a<<" "<<b<<" "<<c<<"\n"
#define o4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<"\n"
#define c4(a,b,c,d) cin>>a>>b>>c>>d;
#define c5(a,b,c,d,e) cin>>a>>b>>c>>d>>e;
#define c6(a,b,c,d,e,f) cin>>a>>b>>c>>d>>e>>f;
#define vlli vector <lli>
#define slli set<lli>
#define mlli map<lli,lli>
#define grt greater<>()
#define mod 1000000007
#define inp(a,n) forr(i,0,n)cin>>a[i];
#define out(a,n) forr(i,0,n)o(a[i]);nl;
#define printdecimal(a,n) cout<<setprecision(n)<<fixed<<a; //round of krke
#define indexed_set_lli tree<lli,null_type,less<lli>,rb_tree_tag,tree_order_statistics_node_update>
#define indexed_set_string tree<string,null_type,less<string>,rb_tree_tag,tree_order_statistics_node_update>
#define fbo(a) find_by_order(a)  //returns a pointer to element
#define indexof(a) order_of_key(a)  //returns index
#define yess cout<<"Yes\n"
#define noo cout<<"No\n"
#define yesno(f) if(f) noo ; else yess; //f=0 means yes f is condition
using namespace std;

lli countSubarrays(lli arr[],
                   lli n, lli k)
{
    lli start = 0, end = 0,
        count = 0, sum = arr[0];

    while (start < n && end < n) {

        // If sum is less than k,
        // move end by one position.
        // Update count and sum
        // accordingly.
        if (sum < k) {
            end++;

            if (end >= start)
                count += end - start;

            // For last element,
            // end may become n
            if (end < n)
                sum += arr[end];
        }

        // If sum is greater than or
        // equal to k, subtract
        // arr[start] from sum and
        // decrease sliding window by
        // moving start by one position
        else {
            sum -= arr[start];
            start++;
        }
    }

    return count;
}
inline lli modadd(lli n,lli m){
    lli sum = ((n+m)%mod+mod)%mod;
    return sum;
}
inline lli modsub(lli n,lli m){
    lli diff = ((n-m+mod)%mod+mod)%mod;
    return diff;
}

inline lli modpro(lli n,lli m){
    lli pro = ((n*m)%mod+mod)%mod;
    return pro;
}
inline lli pow(int x,int y){
    lli res = 1;
    while (y > 0) {
        if (y & 1)
            res = res * x;
        y = y >> 1;
        x = x * x;
    }
    return res;
}
inline lli powmod(lli x,lli y){
    lli res = 1;
    while (y > 0) {
        if (y & 1)
            res = modpro(res , x);
        y = y >> 1;
        x = modpro(x , x);
    }
    return res;
}
bool sortbysec(const pair<lli,lli> &a,
              const pair<lli,lli> &b)
{
    return (a.second < b.second);
}

lli min(lli a, lli b){
    if(a>b){
        return b;
    }
    return a;
}

lli max(lli a, lli b){
    if(a>b){
        return a;
    }
    return b;
}
lli nc2(lli x){
return ((x)*(x-1))/2;
}
string DecToBin(lli n){
    string s="";
    while(n!=0){
      //  s=to_string(n%2)+s;
        n/=2;
    }
    return "0"+s;
}

lli SolveBin(string s){
    lli ans=0;
    lli prod=1;
    rfor(i,s.si-1,0){
        ans+=prod*(s[i]-48);
        prod*=2;
    }
    return ans;
}
lli n;
 map<lli,lli> parent;
 map<lli,lli> Rank;
 map<lli,lli> Siz;

void makeset(){
    for(lli i=1;i<n+1;i++){
        parent[i]=i;
        Siz[i]=1;
    }
}

lli find(lli i){                            // find by path-compression
    if(parent[i]!=i){
        parent[i]=find(parent[i]);
    }
    return parent[i];
}


void Union(lli i,lli j){                    //union by rank
    lli irep=find(i),irank,jrank,isz,jsz;
    lli jrep=find(j);

    if(irep==jrep){
        return;
    }else{
         irank = Rank[irep];
         jrank = Rank[jrep];
         isz=Siz[irep];
         jsz=Siz[jrep];
        if(irank>jrank){
            parent[jrep]=irep;
            Siz[irep]+=Siz[jrep];
        }else if(jrank>irank){
            parent[irep]=jrep;
             Siz[jrep]+=Siz[irep];
        }else{
            parent[jrep]=irep;
            Siz[irep]+=Siz[jrep];
            Rank[irep]++;
        }
    }
}
lli phi(lli n)
{
  int res=n;
  for(int i=2;i*i<=n;i++)
  {
    if(n%i==0)
    {
      while(n%i==0)n/=i;
      res-=res/i;
    }
  }
  if(n>1)res-=res/n;
  return res;
}


void SieveOfEratosthenes(int n, bool prime[], 
						bool primesquare[], int a[]) 
{ 
	// Create a boolean array "prime[0..n]" and 
	// initialize all entries it as true. A value 
	// in prime[i] will finally be false if i is 
	// Not a prime, else true. 
	for (int i = 2; i <= n; i++) 
		prime[i] = true; 

	// Create a boolean array "primesquare[0..n*n+1]" 
	// and initialize all entries it as false. A value 
	// in squareprime[i] will finally be true if i is 
	// square of prime, else false. 
	for (int i = 0; i <= (n * n + 1); i++) 
		primesquare[i] = false; 

	// 1 is not a prime number 
	prime[1] = false; 

	for (int p = 2; p * p <= n; p++) { 
		// If prime[p] is not changed, then 
		// it is a prime 
		if (prime[p] == true) { 
			// Update all multiples of p 
			for (int i = p * 2; i <= n; i += p) 
				prime[i] = false; 
		} 
	} 

	int j = 0; 
	for (int p = 2; p <= n; p++) { 
		if (prime[p]) { 
			// Storing primes in an array 
			a[j] = p; 

			// Update value in primesquare[p*p], 
			// if p is prime. 
			primesquare[p * p] = true; 
			j++; 
		} 
	} 
} 



// Function to count divisors 
int countDivisors(int n) 
{ 
	// If number is 1, then it will have only 1 
	// as a factor. So, total factors will be 1. 
	if (n == 1) 
		return 1; 

	bool prime[n + 1], primesquare[n * n + 1]; 

	int a[n]; // for storing primes upto n 

	// Calling SieveOfEratosthenes to store prime 
	// factors of n and to store square of prime 
	// factors of n 
	SieveOfEratosthenes(n, prime, primesquare, a); 

	// ans will contain total number of distinct 
	// divisors 
	int ans = 1; 

	// Loop for counting factors of n 
	for (int i = 0;; i++) { 
		// a[i] is not less than cube root n 
		if (a[i] * a[i] * a[i] > n) 
			break; 

		// Calculating power of a[i] in n. 
		int cnt = 1; // cnt is power of prime a[i] in n. 
		while (n % a[i] == 0) // if a[i] is a factor of n 
		{ 
			n = n / a[i]; 
			cnt = cnt + 1; // incrementing power 
		} 

		// Calculating number of divisors 
		// If n = a^p * b^q then total divisors of n 
		// are (p+1)*(q+1) 
		ans = ans * cnt; 
	} 

	// if a[i] is greater than cube root of n 

	// First case 
	if (prime[n]) 
		ans = ans * 2; 

	// Second case 
	else if (primesquare[n]) 
		ans = ans * 3; 

	// Third casse 
	else if (n != 1) 
		ans = ans * 4; 

	return ans; // Total divisors 
} 

vlli countDivisors(lli n) 
{ 
    lli cnt = 0; 
    vlli v;
    for (lli i = 1; i <= sqrt(n); i++) { 
        if (n % i == 0) { 
            // If divisors are equal, 
            // count only one 
            v.pb(i);
            if (n / i != i) 
                v.pb(n/i); 
  
            
        } 
    } 
    return v; 
}
int main() {
    JaiHindDosto;
	lli test=1;
	//cin>>test;
    lli wow = test;
	while(test--){
        lli n;
        cin>>n;
        lli a[n];
        inp(a,n);
        sort(a,a+n);
        mlli m;
        forr(i,0,n)m[a[i]]++;

        slli s;
        lli cnt=0;
        forr(i,0,n){
            if(m[a[i]]>1){s.insert(a[i]);continue;}
            vlli xx=countDivisors(a[i]);
            lli f=0;
            //sort(all(xx));
            //out(xx,xx.si);
            forr(j,0,xx.si){
                
                if(s.count(xx[j])){
                    f=1;
                    break;
                }
            }
            if(f==0)cnt++;
            s.insert(a[i]);
        }
        cout<<cnt<<endl;
    }
	return 0; 
}

























Measured memory_bytes: 27048