#include<cstdio>
const int maxn=1e6+1;
int vis[maxn],a[maxn],n,ans;
int main(){
  scanf("%d",&n);
  for(int i=1;i<=n;i++)scanf("%d",a+i),vis[a[i]]++;
  for(int i=1;i<=n;i++){
    if(a[i]==1){ans+=(vis[1]==1);continue;}
    if(vis[a[i]]>1||vis[1]>0)continue;bool v=1;
    for(int j=2;j*j<=a[i];j++){
      if(a[i]%j==0){
        v&=(vis[j]==0)&(vis[a[i]/j]==0);
      }
    }
    ans+=v;
  }
  printf("%d\n",ans);
}