n = input()
s = 0
while n > 0:
	n -= 1
	a = input()
	count = 0
	for i in range(1, int(a**0.5)+1):
		count += (a%i==0)
	if count == 1:
		s += 1
	#if sum(map(lambda x: a%x==0, range(1, int(a**0.5)+1))) == 1:
	#	s += 1
print s

		