#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
int cmpint(const void *x, const void *y) {
	return *(int *)x - *(int *)y;
}
int a[200000];
int binarySearch(int key, int num) {
	int ok = -1, ng = num, mid;
	while (ng - ok > 1) {
		mid = (ng + ok) / 2;
		if (a[mid] <= key)
			ok = mid;
		else
			ng = mid;
	}
	return ok;
}

typedef long long ll;
int main() {
	int n;
	scanf("%d", &n);
	int ans = 0;
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}
	qsort(a, n, sizeof(int), cmpint);
	for (int i = 0; i < n; i++) {
		bool ok = true;
		int x = a[i];
		for (ll j = 2; j * j <= x; j++) {
			if (x % j == 0) {
				int r = binarySearch(j, n);
				if (a[r] == j) {
					ok = false;
					break;
				}
				r = binarySearch(x / j, n);
				if (a[r] == x / j) {
					ok = false;
					break;
				}
			}
		}
		if ((i != 0 && a[i - 1] == x) || (i != n - 1 && a[i + 1] == x)) {
			ok = false;
		}
		if (ok) {
			// printf("%d\n", x);
			ans++;
		}
	}
	printf("%d\n", ans);
	return 0;
}