
import math

numbers = []
n = int(raw_input())
count = 0

for i in range(n):
	input_num = raw_input()
	numbers.append(int(input_num))

for num in numbers:
	prime_flag = True
	for i in range(2, int(math.sqrt(num)) + 1):
		if num % i == 0:
			prime_flag = False

	if i >= 1:
		if i == 2:
			count += 1
			continue

		if i % 2 != 0:
			for j in range(3, int(math.sqrt(i))):
				if x % j != 0:
					count += 1
					continue
print count