#include <stdio.h>
#define rep(i,n)for(int i=0;i<(int)(n);i++)
#define N 1000010
int main(){
	int n,t,a[N]={0},ans=0;
	scanf("%d",&n);
	rep(i,n){scanf("%d",&t);a[t]++;}
	rep(i,N){//ふるい
		if(!a[i])continue;
		if(a[i]==1)ans++;else a[i]=0;
		for(int j=i*2;j<N;j+=i)a[j]=0;
	}
	printf("%d",ans);
}