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


int main(){
    int N, A[(int)2e5], max=0;
    scanf("%d", &N);
    for(int i=0;i<N;i++){
        scanf("%d", &A[i]);
        if(max<A[i]) max = A[i];
    }
    // end input

    int e[(int)1e6+1] = {0};
    for(int i=0;i<N;i++){
        int n = A[i];
        for(int j=A[i]*2;j<max+1;j+=A[i]){
            e[j] = 1;
        }
    }

    int count = 0;
    for(int i=0;i<N;i++){
        if(e[A[i]] == -1){
            count--;
            e[A[i]] = -2;
            continue;
        }
        if(e[A[i]]==0){
            //printf("match: %d\n", A[i]);
            e[A[i]] = -1;
            count++;
        }
    }
    printf("%d\n", count);

    return 0;
}

