n = int(input())
ls = []
counter = 0
for i in range(n):
	ls.append(int(input()))
for k in ls:
	s = 2
	ms = k
	if k == 2:
		counter += 1
	else:
		while ms >= s:
			if k % s == 0:
				break
			ms = k // s + 1
			s += 1
		else:
			counter += 1
print(counter)
