#include <stdio.h>

int main(){
  int i,j,n,flag,result,tmp;
  int a[200001];
  int prime[2000000][2]={0,0};//0:input,1:prime filter
  
  scanf("%d",&n);
  if(1<n){
    for(i=0;i<n;i++){
      scanf("%d",&a[i]);
    
      //prime
      if(prime[(a[i])][0]==0 && prime[(a[i])][1]==0){
        prime[(a[i])][0]=1;
        tmp=a[i];
        while(tmp<=1000000){
          tmp+=a[i];
          prime[tmp][0]=1;
          prime[tmp][1]=1;
        }
      } else if(prime[(a[i])][0]==1){
        prime[(a[i])][1]=1;
      }
    }
    
    result=0;
    
    for(i=0;i<n;i++){
      flag=0;
        if(prime[(a[i])][1]==0){
          result++;
        }
    }
  } else {
    result=1;
  }
    
  printf("%d",result);
}