import math
n=int(input())
a=[]
b=[]
j=3
for i in range(n):
	a.append(int(input()))
for i in a:
	if i==2:
		b.append(i)
	elif i<2 or i%2==0:
		pass
	elif i<=math.sqrt(i):
		if i%j==0:
			pass
	else:
		b.append(i)
print(len(b))
