from math import sqrt

n=int(input())

count=0




for i in range(n):
    x=int(input())
    if x==1:
        count=count+1
    elif x!=2 and x%2==0:
        count=count
    elif x==2 or x==3 or x==5:
        count=count
    else:
        for j in range(2,int(sqrt(x))+1): 
            print(j)
            if x%j==0:
                count=count+1
                break



print(n-count)


