#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 ans = 0;

  if(a[1] == 1){
    if(a[2] != 1)  ans = 1;
    printf("%d\n", ans);
    return 0;
  }

  int isNo[1000006] = {0};

  for(int i=1; i<=n; i++){
    if(a[i-1]==a[i] || a[i]==a[i+1]){ isNo[a[i]] = 1;  continue; }
    int soin[120] = {0}, ai = a[i];
    for(int s=2; s*s<=ai; s++)
      while(ai%s == 0){
	soin[++soin[0]] = s;
	ai /= s;
      }
    if(ai != 1)  soin[++soin[0]] = ai;
    int isOk = 1;
    for(int bit=1; bit<(1<<soin[0]); bit++){
      int yaku = 1;
      for(int j=1; j<=soin[0]; j++)
	if(bit & (1<<(j-1)))
	  yaku *= soin[j];
      if(isNo[yaku]){
	isOk = 0;
	break;
      }
    }
    if(isOk)  ans++;
    isNo[a[i]] = 1;
  }

  printf("%d\n", ans);
  
  return 0;
}
