import sys
import math
def get_prime(m):
    a = [2]+[i for i in range(3,m+1,2)]
    end = int(math.sqrt(m))
    for i in range(3, end, 2):
        if (i in a):
            for j in range(i*2, m, i):
                if (j in a):
                    a.remove(j)
            
    return a
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
primes = get_prime(max(a))
result = 0
for i in range(n):
    if a[i] in primes:
        result+=1
print(result)