N=10**8
p=[i for i in range(N)]
for i in range(2,int(N**0.5)+1):
    if p[i]:
        for j in range(i*i,N,i):p[j]=0
p=sorted(set(p))[2:]
n=int(input())
print(sum(1 for _ in range(n) if int(input()) in p))