def isPrimeNum(x):
	if x % 2 == 0:
		return False
	i = 3
	while i < x:
		if x % i == 0:
			return False
		i += 2
	return True

# input
n = int(raw_input())

if n < 1 or n > 10000:
	exit()

count = 0

for i in range(0, n):
	e = int(raw_input())
	if e < 2 or e > 1000000000:
		exit()
	if isPrimeNum(e):
		count += 1

print count