#include <stdio.h>
int main(void){
    int c[1000001]={},a[200000],n, p[1000001]={},ans=0;
    scanf("%d",&n);
    for(int i=0;i<n;++i){
        scanf("%d",&a[i]);
        ++c[a[i]];
    }
    for(int i=2;i<1000001;++i){
        if(!p[i]){
            for(int j=i+i;j<1000001;j+=i) p[j] = 1;
        }
    }
    for(int i=2;i<1000001;++i){
        if(!p[i]){
            for(int j=1,jj=i;jj<1000001;++j,jj+=i) c[jj]+=c[j];
        }
    }
    for(int i=0;i<n;++i) if(c[a[i]] == 1) ++ans;
    printf("%d",ans);
}


