def main():
    N = int(raw_input())
    count = 0
    for i in range(0,N):
        a = int(raw_input())
        if checkPrimeNum(a):
            count += 1
    print count

cached = [2]
def checkPrimeNum(num):
    print "cached:{0}".format(" ".join(map(str,cached)))
    for i in range(2,num):
        # check i is prime num
        if cached.count(i) >1:
            isPrime = True
            for j in range(2,i):
                if i % j == 0:
                    isPrime = False
                    break
            if isPrime:
                print ""
                cached.append(i)
        if  num % i == 0:
            return False
    if cached.count(num) == 0:
        cached.append(num)
    return True

main()