#include<bits/stdc++.h>
using namespace std;

const int maxn=1000002;
int n, ans=0, cnt[maxn+3], divs[maxn+3];

int main(){
	memset(cnt,0,sizeof cnt);
	memset(divs,0,sizeof divs);
	cin >> n;
	for (int i=0;i<n;i++){
		int a;
		cin >> a;
		cnt[a]++;
	}
	for (int i=1;i<=maxn;i++){
		if (cnt[i]>0){
			if (cnt[i]==1 && divs[i]==0) ans++;
			for (int j=i+i;j<=maxn;j+=i) divs[j]++;
		}
	}
	cout << ans << "\n";
}