import math

N = int(input())

Z = [int(input()) for i in range(N)]

ctr = 0

for j in range(N):
	if Z[j] == 2:
		ctr += 1
	elif Z[j] < 2 or (Z[j] % 2) == 0:
		pass
	else:
		Up = math.sqrt(Z[j])
		k = 3
		while k<= Up:
			if (Z[j] % k) == 0:
				break
			else:
				k += 1
		else:
			ctr += 1

print(ctr) import math math N = int(input()) N int(input()) int input() input int(input()) for i in range(N) for i in range(N) i range(N) range N for i in range(N) int(input()) int input() input Z = [int(input()) for i in range(N)] Z [int(input()) for i in range(N)] ctr = 0 ctr 0 for j in range(N):
	if Z[j] == 2:
		ctr += 1
	elif Z[j] < 2 or (Z[j] % 2) == 0:
		pass
	else:
		Up = math.sqrt(Z[j])
		k = 3
		while k<= Up:
			if (Z[j] % k) == 0:
				break
			else:
				k += 1
		else:
			ctr += 1 j range(N) range N if Z[j] == 2:
		ctr += 1
	elif Z[j] < 2 or (Z[j] % 2) == 0:
		pass
	else:
		Up = math.sqrt(Z[j])
		k = 3
		while k<= Up:
			if (Z[j] % k) == 0:
				break
			else:
				k += 1
		else:
			ctr += 1 Z[j] == 2 Z[j] Z j 2 ctr += 1 ctr 1 elif Z[j] < 2 or (Z[j] % 2) == 0:
		pass
	 Z[j] < 2 or (Z[j] % 2) == 0 Z[j] < 2 Z[j] Z j 2 (Z[j] % 2) == 0 Z[j] % 2 Z[j] Z j 2 0 Up = math.sqrt(Z[j]) Up math.sqrt(Z[j]) math.sqrt math sqrt Z[j] Z j k = 3 k 3 while k<= Up:
			if (Z[j] % k) == 0:
				break
			else:
				k += 1
		else:
			ctr += 1 k<= Up k Up if (Z[j] % k) == 0:
				break
			else:
				k += 1
		 (Z[j] % k) == 0 Z[j] % k Z[j] Z j k 0 break k += 1 k 1 ctr += 1 ctr 1 print(ctr) print ctr ctr += 1 1 ctr k += 1 1 k Z = [int(input()) for i in range(N)] [int(input()) for i in range(N)] Z Up = math.sqrt(Z[j]) math.sqrt(Z[j]) Up ctr += 1 1 ctr k = 3 3 k N = int(input()) int(input()) N ctr = 0 0 ctr
import math

N = int(input())

Z = [int(input()) for i in range(N)]

ctr = 0

for j in range(N):
	if Z[j] == 2:
		ctr += 1
	elif Z[j] < 2 or (Z[j] % 2) == 0:
		pass
	else:
		Up = math.sqrt(Z[j])
		k = 3
		while k<= Up:
			if (Z[j] % k) == 0:
				break
			else:
				k += 1
		else:
			ctr += 1

print(ctr)