n = int(input())
a = {int(input()) for i in range(n)}


def prime_list(a):
    p = [i for i in range(2, max(a) + 1)]
    N = len(p)
    m = int(N**0.5) + 1
    for i in range(m):
        if p[i]>0:
            for j in range(i + 1, N):
                if p[j] % p[i] == 0:
                    p[j] = 0
    p = set(p)
    return p

p = prime_list(a)
primes = p & a
print(len(primes))