def judge_prime(x):
    is_prime=True
    for i in range(2,int(x**0.5)+1):
        if x%i==0:
            is_prime=False
    return is_prime

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