#include <stdio.h>
#define swap(type, x, y)  do{ type t = x; x = y; y = t; }while(0)

void quick(int array[], int left, int right){
  int pl = left, pr = right, x = array[(left+right)/2];
  do{
    while(array[pl] < x)  pl++;
    while(array[pr] > x)  pr--;
    if(pl <= pr){
      swap(int, array[pl], array[pr]);
      pl++, pr--;
    }
  }while(pl <= pr);
  if(pl < right)  quick(array, pl, right);
  if(pr > left)   quick(array, left, pr);
}

int main(){
  int n;  scanf("%d", &n);
  int a[200005] = {0};
  for(int i=1; i<=n; i++)  scanf("%d", a+i);
  quick(a, 1, n);
  int table[1000006] = {0};  table[a[1]] = 0;
  long ans = 0;
  for(int i=1; i<=n; i++){
    if(a[i-1]==a[i] || a[i]==a[i+1]){ table[a[i]] = 1;  continue; }
    int soin[600] = {0};
    int ai = a[i];
    for(int j=2; j*j<=a[i]; j++){
      while(ai%j==0){
	soin[++soin[0]] = j;
	ai /= j;
      }
    }
    if(ai!=1) soin[++soin[0]] = ai;
    int thisans = 1;
    for(int bit=1; bit<(1<<soin[0]); bit++){
      int yaku = 1;
      for(int b=0; b<soin[0]; b++){
	if(bit & (1<<b))
	  yaku *= soin[b+1];
      }
      if(table[yaku]){ thisans = 0; break; }
    }
    if(thisans){  ans++;}// printf("ok : %d\n", a[i]); }
    table[a[i]] = 1;
  }
  printf("%ld\n", ans);
  return 0;
}
