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

int arr[200005], ans;
int cnt[2000005];

int main(){ 
	int n;
	cin >> n;
	for(int i = 1;i <= n;i++){
		cin >> arr[i];
		cnt[arr[i]]++;
	}

	for(int i = 1;i <= n;++i){
		if(cnt[arr[i]] > 1 || (cnt[1] && arr[i] != 1) )
			continue;
		bool ok = 1;
		for(int j = 2;j * j <= arr[i];++j){
			if(arr[i] % j != 0)
				continue;
			ok &= ((cnt[j] > 0) || (cnt[arr[i] / j])) ^ 1;
		}
		ans += ok;
	}

	cout << ans;
}