from math import sqrt
def isprime(farm, prime):
	
	first = min(farm)
	prime.append(first)
	maxfarm = max(farm)
	dellst = range(first, maxfarm+1, first)
	farm = set(farm - set(dellst))
	if len(farm) > 0 and sqrt(maxfarm) > first:
		return isprime(farm, prime)
	else:
		return prime.extend(farm)

n = int(input())
inlst = []
for i in range(n):
	inlst.append(int(input()))
	
farm = set(range(2, max(inlst)+1, 1))
prime = [1]

if len(farm) > 0:
	isprime(farm, prime)
	
out = list(set(inlst) & set(prime))
print(len(out))