#include <stdlib.h>
#include <stdio.h>

#define N  200000
#define A 1000000
int arr[N], dp[A+1];

int icmp(const void *a, const void *b) {
	const int *ap = a, *bp = b;
	return *ap - *bp;
}

int main(void) {
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
		scanf("%d", &arr[i]);
	qsort(arr, n, sizeof arr[0], icmp);

	int ans = 0;
	for (int i = 0; i < n; i++) {
		int x = arr[i];

		if (i > 0 && arr[i-1] == x && dp[x] == 2) {
			ans--;
			dp[x] = 1;
			continue;
		}
		if (dp[x])
			continue;

		dp[x] = 2;
		for (int y = x*2; y <= A; y += x)
			dp[y] = 1;
		ans++;
	}

	printf("%d\n", ans);
}
