n=int(input())
data=[]
for i in range(n):
    data.append(int(input()))
ans=n
for i in data:
    j=2
    while j*j<=i:
        if i%j==0:
            ans-=1
            break
        j+=1

print(ans)


