from sys import stdin

n = int(stdin.readline().rstrip())
nNum = [int(stdin.readline().rstrip()) for i in range(n)]
nNum.sort(reverse=True)

def sieveOfEratos(n):
    isPrime = [False] * 2 + [True] * (n-1)
    for i in range(2, n+1):
        if i * i >= n+1:
            break
        elif isPrime[i]:
            for j in range(i*i, n+1, i):
                isPrime[j] = False

    return isPrime

isPrime = sieveOfEratos(nNum[0])
print(len([True for i in nNum if isPrime[i] == True]))
