n = input()
cnt = 0
for i in range(0, n):
	x =  input() 
	if (x > 1) :
		for j in range(2, x):
			if (x%j == 0):
				break
			if (j== x-1):
				cnt = cnt + 1
	
	if (x == 2):
		cnt = cnt + 1

print(cnt)
				
		
