def get_sieve_of_eratosthenes(x):
    a = [True] * (x + 1)
    a[0] = a[1] = False
    y = 2
    i = 0
    while i <= x ** 1/2:
        if a[i]:
            j = i + 1
            while j <= x:
                if j % i == 0:
                    a[j] = False
                j += 1
        i += 1
    res = list()
    for i in range(x + 1):
        if a[i]:
            res.append(i)
    return res


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)
