N =int(input())
prime = [1]*100000001
ans = 0

def eratos():
    prime[0] ,prime[1] = 0,0
    for i in range(2,10000):
        if prime[i] == 1:
            j = i + i
            while j <= 100000000:
                prime[j] = 0
                j += i

eratos()
for i in range(N):
    x = int(input())
    if prime[x] == 1:
        ans += 1
print(ans)