n=int(input())
num = [int(input()) for _ in range(n)]
cnt=0
for i in num:
    if i==2:
        cnt+=1
    if i<2 or i%2==0:
        continue
    j=3
   
    while j*j<=i:
        if i%j==0:
            break
        j+=2
    else:
        cnt+=1

print(cnt)
    

