#include<stdio.h>
int main(void){
	int n,a[2000000];
	int map[2000000]={0};
	int i,j;
	int h,flg,tmp;
	int sum=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	h=n;flg=1;
	while(h>1||flg){
		if(h>1) h=h/1.3;
		if(h==10||h==9) h=11;
		flg=0;
		for(i=0;i<n-h;i++){
			if(a[i]>a[i+h]){
				tmp=a[i];
				a[i]=a[i+h];
				a[i+h]=tmp;
				flg=1;
			}
		}
	}
	for(i=0;i<n;i++){
		if(a[i]!=a[i+1]&&map[a[i]]==0) sum++;
		if(map[a[i]]==0){
			for(j=a[i];j<2000000;j+=a[i]){
				map[j]=1;
			}
		}
	}
	printf("%d\n",sum);
	return 0;
}
