# coding: utf-8
# Here your code !
import math
i = input()
count=0

for m in range(int(i)):
    num = int(input())
    arr=[]
    #print(num)
    sq = math.sqrt(num)
    for n in range(1,math.floor(sq)):
        if num%n==0:
            arr.append(n)   
    if len(arr)==1:
        count+=1
print(count)