p=[1]*10001

i=2
while i*i<10000:
    if p[i]:
        j=i+i
        while j<10000:
            p[j]=0
            j+=i
    i+=1
count=0
for i in range(int(input())):
    if p[int(input())]==1:
        count+=1
        
print(count)
