#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C

import math

num = int(input())

result = 0

while num > 0:
	x = int(input())
	isPrime = 0
	if x == 2:
		isPrime = 1
	elif x < 2 or x % 2 == 0:
		pass
	else:
		i = 3
		isPrime2 = 1
		while i <= math.sqrt(x):
			if x % i == 0:
				isPrime2 = 0
				break
			i = i + 2
		if isPrime2:
			isPrime = 1
	if isPrime:
		result += 1
	num -= 1

print(result) import math math num = int(input()) num int(input()) int input() input result = 0 result 0 while num > 0:
	x = int(input())
	isPrime = 0
	if x == 2:
		isPrime = 1
	elif x < 2 or x % 2 == 0:
		pass
	else:
		i = 3
		isPrime2 = 1
		while i <= math.sqrt(x):
			if x % i == 0:
				isPrime2 = 0
				break
			i = i + 2
		if isPrime2:
			isPrime = 1
	if isPrime:
		result += 1
	num -= 1 num > 0 num 0 x = int(input()) x int(input()) int input() input isPrime = 0 isPrime 0 if x == 2:
		isPrime = 1
	elif x < 2 or x % 2 == 0:
		pass
	else:
		i = 3
		isPrime2 = 1
		while i <= math.sqrt(x):
			if x % i == 0:
				isPrime2 = 0
				break
			i = i + 2
		if isPrime2:
			isPrime = 1
	 x == 2 x 2 isPrime = 1 isPrime 1 elif x < 2 or x % 2 == 0:
		pass
	 x < 2 or x % 2 == 0 x < 2 x 2 x % 2 == 0 x % 2 x 2 0 i = 3 i 3 isPrime2 = 1 isPrime2 1 while i <= math.sqrt(x):
			if x % i == 0:
				isPrime2 = 0
				break
			i = i + 2
		 i <= math.sqrt(x) i math.sqrt(x) math.sqrt math sqrt x if x % i == 0:
				isPrime2 = 0
				break
			 x % i == 0 x % i x i 0 isPrime2 = 0 isPrime2 0 break i = i + 2 i i + 2 i 2 if isPrime2:
			isPrime = 1
	 isPrime2 isPrime = 1 isPrime 1 if isPrime:
		result += 1
	 isPrime result += 1 result 1 num -= 1 num 1 print(result) print result isPrime = 0 0 isPrime i = 3 3 i isPrime2 = 1 1 isPrime2 isPrime = 1 1 isPrime num -= 1 1 num result = 0 0 result num = int(input()) int(input()) num x = int(input()) int(input()) x isPrime2 = 0 0 isPrime2 result += 1 1 result i = i + 2 i + 2 i isPrime = 1 1 isPrime
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C

import math

num = int(input())

result = 0

while num > 0:
	x = int(input())
	isPrime = 0
	if x == 2:
		isPrime = 1
	elif x < 2 or x % 2 == 0:
		pass
	else:
		i = 3
		isPrime2 = 1
		while i <= math.sqrt(x):
			if x % i == 0:
				isPrime2 = 0
				break
			i = i + 2
		if isPrime2:
			isPrime = 1
	if isPrime:
		result += 1
	num -= 1

print(result)