def sosu(x):
	for i in range(2,x):
		if x%i==0:
			c=c+1
	if c==0:
		return true
	else:
		return false
cnt=0
m=[]
n=input(int())
for i in range(n):
	m[i]=input(int())
	if sosu(m[i]):
		cnt=cnt+1
print(cnt)
