numberOfInput=int(input())
primeNumbers=[]

def isPrime(researchNumber):
    for devidedBy in range(1,researchNumber+1):
        if researchNumber%devidedBy==0 and devidedBy!=1 and devidedBy!=researchNumber:
            break
        elif researchNumber%devidedBy==0 and devidedBy==researchNumber:
            primeNumbers.append(researchNumber)


#----------------------------------main------------------------------------------
while numberOfInput>0:
    researchNumber=int(input())
    if researchNumber==1:
        pass
    else:
        isPrime(researchNumber)
    numberOfInput-=1
print(len(primeNumbers))
