def isPrime(n):
	for i in range(2, n):
		if i*i>n:
			return 1
		if n % i == 0:
			return 0
	return 1

num = int(input())
result = 0
for _ in range(num):
    target = int(input())
    result += isPrime(target)

print(result)
