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

#define rep(i,k,n) for(int (i)=(k);(i)<(n);(i)++)
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define abs(a) ((a)>0 ?(a):-(a))
#define llong long long

int cmp_int(const void *a,const void *b){
	int *a0=(int*)a,*b0=(int*)b;
	return *b0-*a0;
}

int main(){
  int N; scanf("%d",&N);
  int A[N];
  rep(i,0,N) scanf("%d",&A[i]);
  qsort(A,N,sizeof(int),cmp_int);
  int p[1000001]={0};
  rep(i,0,N){
  	if( p[A[i]]==0 ){
  		if( i!=0 && A[i-1]==A[i] ) p[A[i]]=1;
  		int j=A[i]*2;
  		while(j<1000001){
  			p[j]=1;
  			j+=A[i];
  		}
  	}
  }
  int cnt=0;
  rep(i,0,N){
  	if( p[A[i]]==0 ) cnt++;
  }
  printf("%d",cnt);
  return 0;
}
