#include <stdio.h>

int main(void)
{
	int N, tmp, max, i, ans;
	int nums[1000001] = {0};

	scanf("%d\n", &N);
	max = 0;
	for (i = 0; i < N; i++)
	{
		scanf("%d", &tmp);
		nums[tmp]++;
		if (max < tmp)
			max = tmp;
	}

	// 1がある場合
	if (nums[1] && 1 < N)
	{
		printf("0\n");
		return (0);
	} else if (nums[1])
	{
		printf("1\n");
		return (0);
	}

	ans = 0;
	i = 2;
	while (i <= max)
	{
		if (nums[i] == 0)
		{
			i++;
			continue;
		}
		if (nums[i] == 1)
			ans++;
		int j = i * 2;
		while (j <= max)
		{
			nums[j] = 0;
			j += i;
		}
		i++;
	}
	printf("%d\n", ans);
	return (0);
}