n=int(input())
cnt=0
for i in range(n):
    a=int(input())
    ans=True
    for j in range(2,int(a**0.5)+1):
        if a%j==0:
            ans=False
            break
    if ans:
        cnt+=1
print(cnt)
