def is_prime(x):

    if x == 2:

        return True

    if (x < 2) or (x%2 == 0):

        return False

    return all(x%i for i in range(3, int(x**(0.5) + 1), 2))



N = eval(input())

print(sum(is_prime(eval(input())) for i in range(N)))
def prime_numbers(n):

    cnds = [True] * n

    for x in range(2, int(n**0.5 + 1)):

        if cnds[x]:

            for m in range(2*x, n, x):

                cnds[m] = False

    return [i for i in range(2, n) if cnds[i]]



def is_prime(n):

    return all(n % m for m in primes if m < n)



primes = prime_numbers(10**4)

N = eval(input())

print(sum(is_prime(eval(input())) for i in range(N)))
def is_prime(x):
    if x == 2:
        return True
    if (x < 2) or (x % 2 == 0):
        return False
    return all(x % i for i in range(3, int(x ** (0.5) + 1), 2))


N = eval(input())
print(sum(is_prime(eval(input())) for i in range(N)))

def prime_numbers(n):
    cnds = [True] * n
    for x in range(2, int(n**0.5 + 1)):
        if cnds[x]:
            for m in range(2 * x, n, x):
                cnds[m] = False
    return [i for i in range(2, n) if cnds[i]]


def is_prime(n):
    return all(n % m for m in primes if m < n)


primes = prime_numbers(10**4)
N = eval(input())
print(sum(is_prime(eval(input())) for i in range(N)))

-def is_prime(x): -    if x == 2: -        return True -    if (x < 2) or (x % 2 == 0): -        return False -    return all(x % i for i in range(3, int(x ** (0.5) + 1), 2)) +def prime_numbers(n): +    cnds = [True] * n +    for x in range(2, int(n**0.5 + 1)): +        if cnds[x]: +            for m in range(2 * x, n, x): +                cnds[m] = False +    return [i for i in range(2, n) if cnds[i]] +def is_prime(n): +    return all(n % m for m in primes if m < n) + + +primes = prime_numbers(10**4)