#define N 1000009
i,j,n,a[N],b[N]={},ans=0;
main(){
 scanf("%d",&n);
 for(i=0;i<n;i++){scanf("%d",a+i);b[a[i]]++;}
 for(i=1;i<N;i++){
   if(b[i]==1)ans++;
   if(b[i])for(j=2;j*i<N;j++)b[i*j]=0;
 }
 printf("%d",ans);
}