def isPrime(x):
    if x <= 1:
        return 0
    for i in range(2, int(x**0.5) + 1):
        if x % i == 0:
            return 0
    return 1

n = int(input())
sum = 0

for i in range(n):
    if isPrime(int(input())):
        sum += 1
print(sum)
