N = int(input())
ans = 0
for i in range(N):
    n = int(input())
    if n==2:ans+=1
    elif n%2==0:continue
    for j in range(3,n+1,2):
        if j**2 > n:
            ans+=1
            break
        if n%j==0:break
print(ans)
