def sosu(int x):
	for i in range(2,x):
		if x%i=0:
			c++
	if c=0:
		return true:
	else:
		return false:

cnt=0
n=input(int())
for i in range(n):
	m[i]=input(int())
	if sosu(m[i]):
		cnt++
print(cnt)
