n=int(input())
answer=0
for i in range(n):
    t=int(input())
    k=2
    numlist=[0 for i in range(t+1)]
    numlist[0]=-1
    numlist[1]=-1


    read=2
    while read<=t**0.5:
        if numlist[read]==0:
            k=1
            while read*(k+1)<=t:
                numlist[read*(k+1)]=-1
                k+=1
        read+=1

    if numlist[-1]==0:
        answer+=1

print(answer)