
import math

a=int(input())

sum=0

for i in range(n):
	b=1
	n=int(input())
	if n==2 or n==3:
		sum+=1
	if n>3:
		for j in range(2,int(math.sqrt(n))+1):
			if n%j==0:
				b=0
				break
		sum+=b
			
print(sum)
