#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool sieve[(int)1e6+3];
int cnt[(int)1e6+3];
int main(){
	int n;
	cin >> n;
	set<int> ar;
	for(int i=0;i<n;i++){
		int a;
		cin >> a;
		ar.insert(a);
		cnt[a]++;
	}
	int ans = 0;
	for(auto it : ar){
		if(sieve[it]) continue;
		for(int i=it+it;i<(int)1e6+3;i+=it) sieve[i] = 1;
		if(cnt[it] == 1) ans++;
	}
	cout << ans << '\n';
}