import sys

flag = False
cnt = 0

num = input()

for i in range(num):
	data = input()
	for j in range(2,data):
		if data%j == 0:
			flag = True
			break
	if flag == False:
		cnt += 1
	flag = False
print cnt
