def primesUpTo(n):
    primes = [2]
    if n < 2:
        return []

    for i in range(3, n + 1, 2):
        isPrime = True
        for prime in primes[1:]:
            if prime > n ** (1 / 2):
                break
            if i % prime == 0:
                isPrime = False
                break
        if isPrime:
            primes.append(i)

    return primes

n = int(input())
l = [int(input()) for _ in range(n)]
primes = primesUpTo(max(l))

print(len([x for x in l if x in primes]))
