class PrimeChecker:

    def __init__(self):
        self.primes = [2,3,5]

    def isPrime(self, n):
        if n in self.primes:
            return True
        else:
            for i in self.primes:
                if n % i == 0:
                    return False

        i = self.primes[-1]
        w = 2 if i % 6 == 5 else 4

        while i * i <= n:
            if self.isPrime(i,n) and n % i == 0:
                return False

            i += w
            w = 6 - w

        self.primes.append(n)

        return True

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