#include<stdio.h>

int main(void){
  int n;
  scanf("%d",&n);

  int a[1000010] , max = 0 , b;
  for(int i = 0;i < n;i ++){
    scanf("%d",&b);
    a[b] ++;
    if(max < b){
      max = b;
    }
  }

  int temp , count;
  for(int i = 1;i <= max;i ++){
    if(a[i] > 0){
      temp = i;
      count = 2;
      while(temp * count<= max){
        a[temp*count] = 0;
        count ++;
      }
      if(a[i] > 1){
        a[i] = 0;
      }
    }
  }
  int ans = 0;
  for(int i = 1;i <= max;i ++){
    if(a[i] != 0){
      ans ++;
    }
  }

  printf("%d\n",ans);

  return 0;
}