def isPrime(x):
    if x==2:
        return True
    if x<2 or x%2==0:
        return False
    i=3
    while i <=x**(1/2):
        if x%i==0:
            return False
        i+=2
    return  True

b=int(input())
z=[]
for i in range(b):
   z+=[int(input())]
z.sort()

n=z[len(z)-1]
a=[j for j in range(n+1)]
def eratos(n):
    for i in range(n+1):

        a[0]=a[1]=False
        if isPrime(i):
            j= i+i
            while j<=n:
                a[j]=False
                j=j+i
    return a
a=eratos(n)
count=0
for i in z:
    if i in a:
        count+=1
print(count)