def isprime(x):
    if x==2:
        return True
    if x<2 or x%2==0:
        return False
    i=3
    while i*i<=x:
        if x%i==0:
            return False
    return True

n = int(input())
ans=0
for i in range(n):
    num=int(input())
    if isprime(num):
       ans+=1
print(ans)
