import math

loopnum = int(input())
cnt = 0
for i in range(loopnum):

	chknum = int(input())
	rootnum = int(math.sqrt(chknum))

	for j in range(2,rootnum+1):
		if chknum % j == 0:
			break
	else:
		cnt += 1

	# TLE
	#for j in range(2,chknum):
	#	if chknum % j == 0:
	#		break
	#else:
	#	cnt += 1

print(cnt)
 import math math loopnum = int(input()) loopnum int(input()) int input() input cnt = 0 cnt 0 for i in range(loopnum):

	chknum = int(input())
	rootnum = int(math.sqrt(chknum))

	for j in range(2,rootnum+1):
		if chknum % j == 0:
			break
	else:
		cnt += 1

	# TLE
	#for j in range(2,chknum):
	#	if chknum % j == 0:
	#		break
	#else:
	#	cnt += 1 i range(loopnum) range loopnum chknum = int(input()) chknum int(input()) int input() input rootnum = int(math.sqrt(chknum)) rootnum int(math.sqrt(chknum)) int math.sqrt(chknum) math.sqrt math sqrt chknum for j in range(2,rootnum+1):
		if chknum % j == 0:
			break
	else:
		cnt += 1

	# TLE
	#for j in range(2,chknum):
	#	if chknum % j == 0:
	#		break
	#else:
	#	cnt += 1 j range(2,rootnum+1) range 2 rootnum+1 rootnum 1 if chknum % j == 0:
			break
	 chknum % j == 0 chknum % j chknum j 0 break cnt += 1 cnt 1 print(cnt) print cnt loopnum = int(input()) int(input()) loopnum rootnum = int(math.sqrt(chknum)) int(math.sqrt(chknum)) rootnum chknum = int(input()) int(input()) chknum cnt = 0 0 cnt cnt += 1 1 cnt
import math

loopnum = int(input())
cnt = 0
for i in range(loopnum):

	chknum = int(input())
	rootnum = int(math.sqrt(chknum))

	for j in range(2,rootnum+1):
		if chknum % j == 0:
			break
	else:
		cnt += 1

	# TLE
	#for j in range(2,chknum):
	#	if chknum % j == 0:
	#		break
	#else:
	#	cnt += 1

print(cnt)

