#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
typedef long long LL;
typedef long double Lf;
#define Rep(i,a,n)for(int i=(int)(a);i<(int)(n);i++)
#define rep(i,n)Rep(i,0,n)
#define Ma(x,y) ((x)>(y)?(x):(y))
#define mi(x,y) ((x)<(y)?(x):(y))
#define MOD 1000000007
int acs(const void* a, const void* b) { return *(int*)a - *(int*)b; } //1,2,3,4
int des(const void* a, const void* b) { return *(int*)b - *(int*)a; }
int cmp_char(const void* a, const void* b) { return *(char*)a - *(char*)b; } //a,b,c,d
int cmp_str(const void* a, const void* b) { return strcmp(*(const char**)a, *(const char**)b); } //aaa,aab
//temmie_のsnippet
#define N 1000009

int main() {
	int n,a[N],b[N]={0},ans=0;
	scanf("%d",&n);
	rep(i,n){scanf("%d",a+i);}
	qsort(a,n,sizeof(int),acs);
	rep(i,n-1)if(a[i]==a[i+1]){b[i]++;b[i+1]++;}
	rep(i,n)if(b[i])a[i]=0;

	//ふるい
	rep(i,N)b[i]=0;
	rep(i,n){
		if(!a[i])continue;
		if(!b[a[i]])ans++;
		for(int j=1;j*a[i]<N;j++)b[j*a[i]]++;
	}
	printf("%d",ans);
}