def get_primes(n):
    x = [0,0]+[i for i in range(2,n+1)]
    for i in range(int(n**0.5+1)):
        e = x[i]
        if e !=0:
            for j in range(e*2, n+1,e):
                x[j] = 0
    return x

PRIMES = get_primes(100000000)
n = int(input())
c = 0
for i in range(n):
    p = int(input())
    if x[p] == 0:
        c += 1
print c