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(3,a+1,2):
            if a%j==0:
                break
            c+=1
        if c==a-3:
            s+=1
print(s)