def eratos(n):
	is_prime = [True for i in range(n+1)]
	for i in range(2, n):
		if i * i > n:
			break
		for j in range(i*i, n, i):
			is_prime[j] = False
	return is_prime

is_prime = eratos(10000)
n = int(input())
ans = 0
for _ in range(n):
    x = int(input())
    if is_prime[x] is True:
        ans += 1

print(ans)
