#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,a[200001],ans,pd[1000001];
bool cmp(int x,int y)
{
	return x<y;
}
void zh(int x)
{
	for(int i=x;i<=1000000;i+=x)
	pd[i]=1;
}
signed main()
{
	scanf("%lld",&n);
	for(int i=1;i<=n;i++)
	scanf("%lld",&a[i]);
	sort(a+1,a+n+1,cmp);
	for(int i=1;i<=n;i++)
	if(pd[a[i]]==0)
	{
		if(a[i]!=a[i+1])
		ans++;
		zh(a[i]);
	}
	printf("%lld",ans);
    return 0;
}