def get_sieve_of_eratosthenes(x):
    prime = [2]
    data = [i + 1 for i in range(2, x, 2)]
    while True:
        p = data[0]
        prime.append(p)
        if p ** 2 > n:
            return prime + data
        data = [e for e in data if e % p != 0]


n = int(input())
pn = get_sieve_of_eratosthenes(10**8)
cnt = 0
for i in range(n):
    x = int(input())
    if x in pn:
        cnt += 1
print(cnt)
