import math

def Eratos(n):
	primes = [2]
	num = [2*i+1 for i in range(1,n//2)]
	tmp = []

	top = 1
	while top < math.sqrt(n):
		top = num[0]
		for i in range(1,len(num)):
			if num[i] % top != 0:
				tmp.append(num[i])
		num = tmp
		tmp = []
		primes.append(top)
	for i in range(len(num)):
		primes.append(num[i])
	return primes

n = int(input())
cont = 0
nums = []
for i in range(n):
	a = int(input())
	nums.append(a)
nums.sort()
primes = Eratos(nums[n-1])
for i in range(n):
	if primes.count(nums[i])!=0:
		cont += 1
print(cont)
