def sosu(x):
	c=0
	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=int(input())
for i in range(n):
	o=int(input())
	m.append(o)
	if sosu(m[i]):
		cnt=cnt+1
print(cnt)
