import math
def is_prime(a):
    j=2
    while(math.sqrt(a)>=j):
        if a%j==0:
           
            return 0
        j+=1
    return 1


N=int(input())
A=[int(input())for i in range(N)]
ans=0

for a in A:
    ans+=is_prime(a)
print(ans)

