#include <stdio.h>
#define Rep(i,a,n)for(int i=(int)(a);i<(int)(n);i++)
#define rep(i,n)Rep(i,0,n)
int main(){
	int n,a[200009],b[1000009],ans=0;
	scanf("%d",&n);
	rep(i,n)scanf("%d",a+i);
	rep(i,n)b[a[i]]++;
	rep(i,n){
		int flag=b[a[i]]==1;
		if(a[i]!=1)flag&=b[1]==0;
		for(int d=2;d*d<=a[i];d++)if(a[i]%d==0)flag&=b[d]==0&&b[a[i]/d]==0;
		if(flag)ans++;
	}
	printf("%d",ans);
}