class PrimeChecker:

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

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

        i = 5
        w = 2

        while i * i < n:
            if 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)
        
