N=int(input())
A=np.empty(N)
for i in range(N):
    A[i]=int(input())
cnt=0
for i in range(N):
    if A[i]%2==0 and A[i]!=2:
        continue
    x=int(np.sqrt(i))+1
    for j in range(2,x):
        if A[i]%j==0:
            break
    cnt=cnt+1
print(cnt)
