#include <stdio.h>
#include <stdlib.h>
int cmp(const void * n1, const void * n2){
  if(*(int *) n1 > *(int *) n2){
    return 1;
  }else if (*(int *) n1 < *(int *) n2){
    return -1;
  }else{
    return 0; 
  }
}
int main(){
    int n, num, cannum, divable, psi, i, j;
    num = 0;
    cannum = 0;
    scanf("%d", &n);
    int ps[n], cands[n];
    for(i=0;i<n;i++)scanf("%d",&ps[i]);
    
    qsort(ps, sizeof(ps)/sizeof(ps[0]), sizeof(int), cmp);
    for(i=0;i<n;i++){
      divable = 0;
      psi = ps[i];

      if (( i != 0 && psi == ps[i-1]) || ( i != n-1 && psi == ps[i+1])){
         divable = 1;
         if (cands[cannum-1] != i){
           cands[cannum++] = i;       
         }
      }else{
        for(j=0;j<cannum;j++){
          if (psi%ps[cands[j]] == 0){
            divable = 1;
            break;
          }
        }
      }
      if (divable == 0){
        num++;
        cands[cannum++] = i;
      }
    }
    printf("%d", num);
    return 0;
}


