def get_sieve_of_eratosthenes(x):
    data = [True] * (x + 1)
    data[0] = data[1] = False
    i = 2
    while i ** 2 <= x:
        if data[i]:
            for j in range(i + 1, x + 1):
                if j % i == 0:
                    data[j] = False
        i += 1
    return data


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