import sys
input=sys.stdin.readline
n=int(input())
cnt=n
for i in range(n):
	a=int(input())
	if a==1:
		cnt-=1
		continue
	for j in range(2,min(int(a**0.5)+2,a)):
		if a%j==0:
			cnt-=1
			break
print(cnt)

