import math

n = int(input())
cnt = 0
for i in range(0, n):
	j = int(input())
	if (1 <= j <= 3):
		continue
	if j % 2 == 0:
		cnt = cnt + 1
		continue
	k = int(math.sqrt(j))
	l = 3
	while l <= k:
		if j % l == 0:
			cnt = cnt + 1
			break
		l = l +1

print(n - cnt)

