#include <stdio.h>
#include <stdlib.h>

int compareInt(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

int main(void){
    unsigned long int n;
    scanf("%ld",&n);

    unsigned long int a[n];
    unsigned long int b[n];
    unsigned int kisuu = 0;
    unsigned int kisuu_cnt = 0;
    int ans=0;
    int flag = 1;
    int isTwo = 0;
    unsigned long int min=10000000;

    for(int i=0;i<n;i++)  {
        scanf("%ld",&a[i]);
        if(a[i] == 2)  isTwo = 1;
    } 
    qsort(a,n,sizeof(unsigned long int),compareInt);
    if(a[0] == 1){
        printf("%ld",n);
        return 0;
    }

    for(int i=0;i<n;i++){
        flag = 1;
        if(a[i] == a[i-1] || a[i] == a[i+1]) flag=0;
        else{
            if(isTwo && (a[i])%2==0 && a[i]!=2){
                flag = 0;
            }else
            for(int j=0;j<i;j++){
                if(a[i]%a[j] == 0){
                    flag = 0;
                    break;
                }
            }
        }

        if(flag == 1) ans ++;
    }


    printf("%d",ans);
    return 0;
}