import math
n=int(input())
s=0

for i in range(n):
    a=int(input())
    b=int(a**0.5)
    #b=math.ceil(a**0.5)
    #print(str(b), '??O') 
    if a==2:
        s+=1
    elif a%2==0 or a < 2:
        continue
    else:
        for j in range(3,b+1,2):
            if j==b:
                s+=1
            elif a%j==0:
                break  
print(s)