#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <stdbool.h>

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

int bisect_left(int x,int a[],int left,int right){
    int mid;
    right++;
    while (left < right) {
        mid = (left + right) / 2;
        if (a[mid] < x) {
            left = mid + 1;
        } else {
            right = mid;
        }
    }
    return left;
}



int main(void){
    int N;
    scanf("%d", &N);
    int *array = (int *)malloc(N * sizeof(int));
    for (int i = 0; i < N; i++) {
        scanf("%d", &array[i]);
    }
    qsort(array,N,sizeof (int), asc);   
    bool flag[100000+10] = {0};
    for (int i = 0; i < N; i++) {
        int now = 2;
        while(now * array[i] <= array[N-1]){
            flag[now * array[i]] = 1;
            now += 1;
        }
    }
    int ans = 0
    for (int i = 0; i < N; i++) {
        if (!flag[ array[i] ]) {
            if (bisect_left(array[i]+1,array,0,N-1)- bisect_left(array[i],array,0,N-1) == 1) {
                ans++;
            }
        }
    }
    printf("%d\n",ans);
}
