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

#define PI 3.141592653589793

int main(void) {
	int n;
	int i;
	int a[100005];
	//int *cnt;

	//cnt = (int*)malloc(sizeof(int) * 1000005);
	int cnt[1000005] = { 0 };
	/*for (i = 0; i <= 1000000; i++)
	{
		cnt[i] = 0;
	}*/
	scanf("%d", &n);

	for (i = 1; i <= n; i++)
	{
		scanf("%d", &a[i]);
	}
	for(i=1;i<=n;i++){
		/*if (cnt[a[i]] != 0)
		{
			
			cnt[a[i]] = 2;
			continue;
		}*/
		for (int j = a[i]; j <= 1000000; j += a[i])
		{
			//printf("%d\n",j);
			cnt[j]++;
		}
	}
	int ans = 0;
	for (i = 1; i <= n; i++)
	{
		//printf("%d\n", cnt[a[i]]);
		if (cnt[a[i]] == 1)ans++;
	}
	//for (i = 1; i <= 1000000; i++) {
		//printf("%d\n", cnt[i]);
	//}
	printf("%d\n", ans);
	return 0;
}