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

int comfun(const void* a, const void *b){
  return (*(int*)a - *(int*)b);
}

int main(void){
  int N, i;
  scanf("%d", &N);
  int A[N];
  
  for(i = 0; i < N; ++i)
     scanf("%d", &A[i]);
  
  qsort(A, N, sizeof(int), comfun);
  
  int arr[1000001] = {0}, ans = 0;
  
  for(i = 0; i < N; ++i){
    
    if(arr[A[i]] == 0){
      ++ans;
      for(int j = 1; j * A[i] <= 1000000; ++j)
        arr[j * A[i]] = 1;
      if(i < N - 1){
        if(A[i] == A[i + 1])
          --ans;
      }
    }
    
  }
  printf("%d\n", ans);
  return 0;
}