#include <cstdio>
using namespace std;

const int N = 1000000;
int a[N + 1];

int main() 
{
	int n;
	scanf("%d", &n);
	int v;
	for (int i = 0; i < n; ++i) {
		scanf("%d", &v);
		++a[v];
	}
	int ans = 0;
	for (int i = 1; i <= N; ++i) if (a[i]) {
		if (a[i] == 1) ++ans;
		for (int j = i; j <= N; j += i) a[j] = 0;
	}
	printf("%d\n", ans);
	return 0;
}
