def is_prime(n):
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            return False
    return n != 1

def witness(a, n, t, u):
    x = pow(a, u, n)  # x0 = a^u mod nを計算
    y = x

    for _ in range(0, t):
        y = (x * x) % n

        # 法nの下での1の非自明な平方根が存在するのはnが合成数であるときに限る
        if y == 1 and x != 1 and x != (n - 1):
            return True
        x = y
    return y != 1

def is_probably_prime(n, witnesses):
    t = 1
    u = n // 2
    while u & 1 == 0:
        t = t + 1
        u >>= 1
    assert(2**t * u == n - 1)

    for a in witnesses:
        if a < n and witness(a, n, t, u):
            return False
    return True

def is_definitely_prime(n):
    if ((not (n & 1)) and n != 2) or (n < 2) or ((n % 3 == 0) and (n != 3)):
        return False
    if n <= 3:
        return True
    return is_probably_prime(n, [2, 7, 61])

n = int(input())
answer = 0
for _ in range(0, n):
    m = int(input())
    if is_definitely_prime(m):
        answer = answer + 1
print(answer) def is_prime(n):
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            return False
    return n != 1 is_prime for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            return False
     i range(2, int(n**0.5) + 1) range 2 int(n**0.5) + 1 int(n**0.5) int n**0.5 n 0.5 1 if n % i == 0:
            return False
     n % i == 0 n % i n i 0 return False False return n != 1 n != 1 n 1 n n def witness(a, n, t, u):
    x = pow(a, u, n)  # x0 = a^u mod nを計算
    y = x

    for _ in range(0, t):
        y = (x * x) % n

        # 法nの下での1の非自明な平方根が存在するのはnが合成数であるときに限る
        if y == 1 and x != 1 and x != (n - 1):
            return True
        x = y
    return y != 1 witness x = pow(a, u, n) x pow(a, u, n) pow a u n y = x y x for _ in range(0, t):
        y = (x * x) % n

        # 法nの下での1の非自明な平方根が存在するのはnが合成数であるときに限る
        if y == 1 and x != 1 and x != (n - 1):
            return True
        x = y
     _ range(0, t) range 0 t y = (x * x) % n y (x * x) % n x * x x x n if y == 1 and x != 1 and x != (n - 1):
            return True
         y == 1 and x != 1 and x != (n - 1) y == 1 and x != 1 y == 1 y 1 x != 1 x 1 x != (n - 1) x n - 1 n 1 return True True x = y x y return y != 1 y != 1 y 1 a a n n t t u u def is_probably_prime(n, witnesses):
    t = 1
    u = n // 2
    while u & 1 == 0:
        t = t + 1
        u >>= 1
    assert(2**t * u == n - 1)

    for a in witnesses:
        if a < n and witness(a, n, t, u):
            return False
    return True is_probably_prime t = 1 t 1 u = n // 2 u n // 2 n 2 while u & 1 == 0:
        t = t + 1
        u >>= 1
     u & 1 == 0 u & 1 u 1 0 t = t + 1 t t + 1 t 1 u >>= 1 u 1 assert(2**t * u == n - 1) 2**t * u == n - 1 2**t * u 2**t 2 t u n - 1 n 1 for a in witnesses:
        if a < n and witness(a, n, t, u):
            return False
     a witnesses if a < n and witness(a, n, t, u):
            return False
     a < n and witness(a, n, t, u) a < n a n witness(a, n, t, u) witness a n t u return False False return True True n n witnesses witnesses def is_definitely_prime(n):
    if ((not (n & 1)) and n != 2) or (n < 2) or ((n % 3 == 0) and (n != 3)):
        return False
    if n <= 3:
        return True
    return is_probably_prime(n, [2, 7, 61]) is_definitely_prime if ((not (n & 1)) and n != 2) or (n < 2) or ((n % 3 == 0) and (n != 3)):
        return False
     ((not (n & 1)) and n != 2) or (n < 2) or ((n % 3 == 0) and (n != 3)) ((not (n & 1)) and n != 2) or (n < 2) (not (n & 1)) and n != 2 not (n & 1) n & 1 n 1 n != 2 n 2 n < 2 n 2 (n % 3 == 0) and (n != 3) n % 3 == 0 n % 3 n 3 0 n != 3 n 3 return False False if n <= 3:
        return True
     n <= 3 n 3 return True True return is_probably_prime(n, [2, 7, 61]) is_probably_prime(n, [2, 7, 61]) is_probably_prime n [2, 7, 61] 2 7 61 n n n = int(input()) n int(input()) int input() input answer = 0 answer 0 for _ in range(0, n):
    m = int(input())
    if is_definitely_prime(m):
        answer = answer + 1 _ range(0, n) range 0 n m = int(input()) m int(input()) int input() input if is_definitely_prime(m):
        answer = answer + 1 is_definitely_prime(m) is_definitely_prime m answer = answer + 1 answer answer + 1 answer 1 print(answer) print answer def is_prime(n):
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            return False
    return n != 1 def is_prime(n):
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            return False
    return n != 1 is_prime def witness(a, n, t, u):
    x = pow(a, u, n)  # x0 = a^u mod nを計算
    y = x

    for _ in range(0, t):
        y = (x * x) % n

        # 法nの下での1の非自明な平方根が存在するのはnが合成数であるときに限る
        if y == 1 and x != 1 and x != (n - 1):
            return True
        x = y
    return y != 1 def witness(a, n, t, u):
    x = pow(a, u, n)  # x0 = a^u mod nを計算
    y = x

    for _ in range(0, t):
        y = (x * x) % n

        # 法nの下での1の非自明な平方根が存在するのはnが合成数であるときに限る
        if y == 1 and x != 1 and x != (n - 1):
            return True
        x = y
    return y != 1 witness def is_probably_prime(n, witnesses):
    t = 1
    u = n // 2
    while u & 1 == 0:
        t = t + 1
        u >>= 1
    assert(2**t * u == n - 1)

    for a in witnesses:
        if a < n and witness(a, n, t, u):
            return False
    return True def is_probably_prime(n, witnesses):
    t = 1
    u = n // 2
    while u & 1 == 0:
        t = t + 1
        u >>= 1
    assert(2**t * u == n - 1)

    for a in witnesses:
        if a < n and witness(a, n, t, u):
            return False
    return True is_probably_prime m = int(input()) int(input()) m answer = 0 0 answer answer = answer + 1 answer + 1 answer def is_definitely_prime(n):
    if ((not (n & 1)) and n != 2) or (n < 2) or ((n % 3 == 0) and (n != 3)):
        return False
    if n <= 3:
        return True
    return is_probably_prime(n, [2, 7, 61]) def is_definitely_prime(n):
    if ((not (n & 1)) and n != 2) or (n < 2) or ((n % 3 == 0) and (n != 3)):
        return False
    if n <= 3:
        return True
    return is_probably_prime(n, [2, 7, 61]) is_definitely_prime n = int(input()) int(input()) n
def is_prime(n):
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            return False
    return n != 1

def witness(a, n, t, u):
    x = pow(a, u, n)  # x0 = a^u mod nを計算
    y = x

    for _ in range(0, t):
        y = (x * x) % n

        # 法nの下での1の非自明な平方根が存在するのはnが合成数であるときに限る
        if y == 1 and x != 1 and x != (n - 1):
            return True
        x = y
    return y != 1

def is_probably_prime(n, witnesses):
    t = 1
    u = n // 2
    while u & 1 == 0:
        t = t + 1
        u >>= 1
    assert(2**t * u == n - 1)

    for a in witnesses:
        if a < n and witness(a, n, t, u):
            return False
    return True

def is_definitely_prime(n):
    if ((not (n & 1)) and n != 2) or (n < 2) or ((n % 3 == 0) and (n != 3)):
        return False
    if n <= 3:
        return True
    return is_probably_prime(n, [2, 7, 61])

n = int(input())
answer = 0
for _ in range(0, n):
    m = int(input())
    if is_definitely_prime(m):
        answer = answer + 1
print(answer)
