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

const int nm = 1e6;
int n, c[nm + 1];
long long ans = 0;

int main() {
	cin >> n;
	for (int i = 0; i < n; ++i) {
		int a;
		cin >> a;
		++c[a];
	}
	for (int i = 1; i <= nm; ++i) {
		if (!c[i])
			continue;
		if (c[i] > 1)
			c[i] = 0;
		for (int j = i * 2; j <= nm; j += i)
			if (c[j])
				c[j] = 0;
	}
	for (int i = 0; i <= nm; ++i)
		ans += c[i];
	cout << ans << endl;
}
