#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdio.h>
int compare(const void *a,const void *b){
    if(*(int *)a>*(int *)b)return 1;
    return -1;
}
int array[1000001]={0};
int main(int argc, const char * argv[]) {
    int n;
    
    scanf("%d",&n);
    int a[n];
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        array[a[i]]++;
    }
    qsort(a,n,sizeof(int),compare);
    
    if(a[0]==1){
        printf("1");
        return 0;
    }
    int ans=0;
    for(int i=0;i<n;i++){
        for(int j=2;j*a[i]<=a[n-1];j++){
            if(array[a[i]*j]>0){
                array[a[i]*j]=0;
                //printf("%d is deleted\n",array[a[i]*j]);
            }
        }
        if(array[a[i]]>1){
            array[a[i]]=0;
            //printf("array %d is deleted bs2\n",array[a[i]]);
        }
    }
    for(int i=0;i<=a[n-1];i++){
        ans+=array[i];
    }
    printf("%d",ans);
    
    return 0;
}
