class PrimeChecker(object):
    def __init__(self):
        self.primes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53]
    
    def isPrime(self, n):
        if n in self.primes:
            return True
        elif n < 53:
            return False
        else:
            for i in self.primes:
                if n % i == 0:
                    return False
            for i in range(53, n//2, 2):
                if n % i == 0:
                    return False
            self.primes.append(n)
            return True


N = int(input())
count = 0
primeChecker = PrimeChecker()
for _ in range(N):
    if primeChecker.isPrime(int(input())):
        count += 1
print(count)


