def is_prime(num):
	if num <= 1: return False
	if num % 2 == 0: return True
	i = 3
	while i <= num**0.5:
		if num % i == 0: return True
		i += 2
	return False
	
n = int(input())
cnt = 0
for i in range(n):
	if is_prime(int(input())):
		cnt += 1
print(cnt)

