import numpy as np
import math
n=int(input())
A=np.empty((n))
B=np.zeros((n))
count=0


for i in range(n):
    A[i]=int(input())
for i in range(n):
    for j in range(2,int(math.sqrt(A[i])+1)):
        if A[i]%j==0:
            B[i]=1 ##素数でないなら1を入力
        break


for i in range(n):
    if B[i]==0:
        count=count+1

print(count)

