#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define ll long long

int n;
int a[1001000];
int b[1001000]={};

int main(){
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%d",&a[i]);
    b[a[i]]++;}
  int ans=0;
  for(int i=1;i<=1000000;i++){
    if(b[i]==1)ans++;
    if(b[i]>0){
    for(int j=2;j*i<=1000000;j++){
      b[i*j]=0;}}}
  
  printf("%d\n",ans);
  
  return 0;
}
