max_count = int(input())

count = 0
for i in range(max_count):
	num = int(input())

	if num % 2 == 0:
		break

	f = 1
	for d in range(3, num, 2):
		if num % d == 0:
			f = 0
			break
	if f == 1:
		count += 1

print(count)