N = input()
prime = 0
checked = 2
primeList = [2]

def is_prime(n):
    global checked
    if n <= checked:
        if n in primeList:
            return True
        else:
            return False
    else:#?´???°????????????n?????§????´???°????????????????????????
        for i in xrange(checked+1, n+1):
            isPrime = True
            for p in primeList:
                if i%p == 0:
                    #print "{}%{} == 0".format(i,p)
                    isPrime = False
                    break
            for p in xrange(checked+1, i):
                if i%p == 0:
                    #print "{}%{} == 0".format(i,p)
                    isPrime = False
                    break
            if isPrime:
                primeList.append(i)
        checked = n
        if primeList[-1] == n:
            return True
        else:
            return False
        

for _ in xrange(N):
    n = input()
    prime += 1 if is_prime(n) else 0
print prime