import math
n=int(input("n:"))
R=[0]*n
sum=0
for i in range(n):
    R[i]=int(input(""))
for i in range(n):
    s=math.sqrt(R[i])
    s=int(s)+1
    for j in range(2,s+1):
        if R[i]==j:
            sum=sum+1
        if R[i]%j==0:
            break
        if j==s:
            sum=sum+1
print(sum)
