#include<stdio.h>
int IN(void)
{
  int x=0;short f=0,c=getchar();while(c<48||c>57){f^=c==45,c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
signed main(void)
{
  int N=IN(),a=0,count=0,max=0,check[1000001]={0};
  for(int i=0;i<N;i++){a=IN();check[a]++;max=a>max?a:max;}
  for(int i=1;i<=max;i++)
  {
    if(check[i]==1){count++;}if(check[i]){for(int j=2;i*j<=max;j++)check[i*j]=0;}
  }
  return printf("%d\n",count),0;
}