from math import sqrt
def isprime(inlst, i, sq):
	inlst = list(filter(lambda x: x % i is not 0 or x is i, inlst))
	if sq >= i:
		return isprime(inlst, i +2, sq)
	else:
		return inlst

n = int(input())
inlst = []
twonum = 0
for i in range(n):
	inlst.append(int(input()))
	
inlst = list(filter(lambda x: x % 2 is not 0 or x is 2, inlst))
i = 3
maxin = max(inlst)
if len(inlst) > 0:
	inlst = isprime(inlst, i, int(sqrt(maxin)) + 1)
print(len(inlst))