#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

int divisor[1000000+10];
void maked(int n){divisor[0]=-1;divisor[1]=1;ll i=2;for(;i*i<=n;i++)if(!divisor[i]){divisor[i]=i;for(ll j=i*i;j<=n;j+=i)if(!divisor[j])divisor[j]=i;}for(;i<=n;i++)if(!divisor[i])divisor[i]=i;}
int divv(ll n,ll*a){//約数（div使用）
	ll cnt=1;a[0]=1;
	while(n!=1){ll num=1,i=divisor[n],temp=i;while(n%i==0){n/=i;num++;}rep(k,1,num){rep(j,0,cnt)a[k*cnt+j]=a[j]*temp;temp*=i;}cnt*=num;}
	//sortup(a,cnt);
	return cnt;
}

int n;
int a[200010];
int aa[1000010];
ll yakusuu[1000];
int main(){
	maked(1000000+5);
	scanf("%d",&n);
	rep(i,0,n)scanf("%d",a+i);
	rep(i,0,n)aa[a[i]]++;

	int ans=0;
	rep(i,0,n){
		int cnt=divv(a[i],yakusuu);
		int flag=aa[a[i]]==1;
		rep(j,0,cnt)if(yakusuu[j]!=a[i])flag&=aa[yakusuu[j]]==0;
		if(flag)ans++;
	}
	
	printf("%d",ans);
}