n=int(input())
s=0
for i in range(n):
    a=int(input())
    c=0
    if a==2:
        s+=1
    else:
        for j in range(2,a,1):
     #  i print(j)
            if a%j==0:
                break
            else:
                if j==a-1:
                    s+=1
print(s)