import math


def is_prime(n):
    global primes
    if n == 1:
        return False

    if n == 2:
        return True

    if n % 2 == 0:
        return False

    s = int(math.sqrt(n))
    for x in range(3, s + 1, 2):
        if n % x == 0:
            return False
    else:
        return True


N = int(input())
d = [int(input()) for _ in range(N)]
d.sort()
print([is_prime(x) for x in d].count(True)) import math math def is_prime(n):
    global primes
    if n == 1:
        return False

    if n == 2:
        return True

    if n % 2 == 0:
        return False

    s = int(math.sqrt(n))
    for x in range(3, s + 1, 2):
        if n % x == 0:
            return False
    else:
        return True is_prime global primes if n == 1:
        return False

     n == 1 n 1 return False False if n == 2:
        return True

     n == 2 n 2 return True True if n % 2 == 0:
        return False

     n % 2 == 0 n % 2 n 2 0 return False False s = int(math.sqrt(n)) s int(math.sqrt(n)) int math.sqrt(n) math.sqrt math sqrt n for x in range(3, s + 1, 2):
        if n % x == 0:
            return False
    else:
        return True x range(3, s + 1, 2) range 3 s + 1 s 1 2 if n % x == 0:
            return False
     n % x == 0 n % x n x 0 return False False return True True n n N = int(input()) N int(input()) int input() input int(input()) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) int(input()) int input() input d = [int(input()) for _ in range(N)] d [int(input()) for _ in range(N)] d.sort() d.sort d sort is_prime(x) for x in d for x in d x d for x in d is_prime(x) is_prime x print([is_prime(x) for x in d].count(True)) print [is_prime(x) for x in d].count(True) [is_prime(x) for x in d].count [is_prime(x) for x in d] count True d = [int(input()) for _ in range(N)] [int(input()) for _ in range(N)] d def is_prime(n):
    global primes
    if n == 1:
        return False

    if n == 2:
        return True

    if n % 2 == 0:
        return False

    s = int(math.sqrt(n))
    for x in range(3, s + 1, 2):
        if n % x == 0:
            return False
    else:
        return True def is_prime(n):
    global primes
    if n == 1:
        return False

    if n == 2:
        return True

    if n % 2 == 0:
        return False

    s = int(math.sqrt(n))
    for x in range(3, s + 1, 2):
        if n % x == 0:
            return False
    else:
        return True is_prime N = int(input()) int(input()) N
import math


def is_prime(n):
    global primes
    if n == 1:
        return False

    if n == 2:
        return True

    if n % 2 == 0:
        return False

    s = int(math.sqrt(n))
    for x in range(3, s + 1, 2):
        if n % x == 0:
            return False
    else:
        return True


N = int(input())
d = [int(input()) for _ in range(N)]
d.sort()
print([is_prime(x) for x in d].count(True))