#include <stdio.h>

int main()
{
	int i, N, A, flag[1000001] = {};
	scanf("%d", &N);
	for (i = 1; i <= N; i++) {
		scanf("%d\n", &A);
		flag[A]++;
	}
	
	int j, ans = 0;
	for (i = 1; i <= 1000000; i++) {
		if (flag[i] != 1) continue;
		else ans++;
		for (j = i; j <= 1000000; j += i) flag[j] = 0;
	}
	printf("%d\n", ans);
	fflush(stdout);
	return 0;
}