
import numpy as np
import math

n=int(input())

A=np.empty((n))
B=np.zeros((n))

count=0

for i in range(n):
    A[i]=int(input())

##print(A)


for i in range(n):
    if A[i]==1:
        B[i]=1
        ##print("ifの1")
    elif A[i]!=2 and A[i]%2==0:
        B[i]=1
        ##print("ifの2")
    else:
        for j in range(2,int(math.sqrt(A[i]))+1):
           ##print("j",j)
            if A[i]%j==0:
                B[i]=1
                break
        ##print("ifの3")
                


for i in range(n):
    if B[i]==0:
        count=count+1



print(count)


