def isprime(n):

    if n == 2:

        return True

    if n % 2 == 0:

        return False

    i = 3

    while i * i <= n:

        if n % i == 0:

            return False

        i += 2

    return True



result = 0

for i in range(int(eval(input()))):

    result += isprime(int(eval(input())))

print(result)
from math import sqrt





def isprime(n):

    if n == 2:

        return True

    if n % 2 == 0:

        return False

    for i in range(3, int(sqrt(n)) + 1, 2):

        if n % i == 0:

            return False

    return True



result = 0

for i in range(int(eval(input()))):

    result += isprime(int(eval(input())))

print(result)
def isprime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    i = 3
    while i * i <= n:
        if n % i == 0:
            return False
        i += 2
    return True


result = 0
for i in range(int(eval(input()))):
    result += isprime(int(eval(input())))
print(result)

from math import sqrt


def isprime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    for i in range(3, int(sqrt(n)) + 1, 2):
        if n % i == 0:
            return False
    return True


result = 0
for i in range(int(eval(input()))):
    result += isprime(int(eval(input())))
print(result)

+from math import sqrt + + -    i = 3 -    while i * i <= n: +    for i in range(3, int(sqrt(n)) + 1, 2): -        i += 2