#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

MAX_PRIME = 10**4
def prime_list():
    sqrt_max = int(MAX_PRIME ** 0.5)
    primes = [True for i in range(MAX_PRIME+1)]
    primes[0] = primes[1] = False

    for p in range(sqrt_max):
        if primes[p]:
            for px in range(p*2, MAX_PRIME, p):
                primes[px] = False

    p_list = [i for i in range(MAX_PRIME) if primes[i]]
    return p_list


def is_prime(n, prime_list):
    sqrt_n = int(n ** 0.5)
    for i in prime_list:
        if i > sqrt_n:
            break
        if n % i == 0:
            return False
    return True

p_list = prime_list()

n = int(sys.stdin.readline())
num_p = 0

for i in range(n):
    x = int(sys.stdin.readline())
    if is_prime(x, p_list):
        num_p += 1
print(num_p)
 import sys sys MAX_PRIME = 10**4 MAX_PRIME 10**4 10 4 def prime_list():
    sqrt_max = int(MAX_PRIME ** 0.5)
    primes = [True for i in range(MAX_PRIME+1)]
    primes[0] = primes[1] = False

    for p in range(sqrt_max):
        if primes[p]:
            for px in range(p*2, MAX_PRIME, p):
                primes[px] = False

    p_list = [i for i in range(MAX_PRIME) if primes[i]]
    return p_list prime_list sqrt_max = int(MAX_PRIME ** 0.5) sqrt_max int(MAX_PRIME ** 0.5) int MAX_PRIME ** 0.5 MAX_PRIME 0.5 True for i in range(MAX_PRIME+1) for i in range(MAX_PRIME+1) i range(MAX_PRIME+1) range MAX_PRIME+1 MAX_PRIME 1 for i in range(MAX_PRIME+1) True primes = [True for i in range(MAX_PRIME+1)] primes [True for i in range(MAX_PRIME+1)] primes[0] = primes[1] = False primes[0] primes 0 False = primes[1] = False primes[1] primes 1 False for p in range(sqrt_max):
        if primes[p]:
            for px in range(p*2, MAX_PRIME, p):
                primes[px] = False

     p range(sqrt_max) range sqrt_max if primes[p]:
            for px in range(p*2, MAX_PRIME, p):
                primes[px] = False

     primes[p] primes p for px in range(p*2, MAX_PRIME, p):
                primes[px] = False

     px range(p*2, MAX_PRIME, p) range p*2 p 2 MAX_PRIME p primes[px] = False primes[px] primes px False i for i in range(MAX_PRIME) if primes[i] for i in range(MAX_PRIME) if primes[i] i range(MAX_PRIME) range MAX_PRIME primes[i] primes i if primes[i] i p_list = [i for i in range(MAX_PRIME) if primes[i]] p_list [i for i in range(MAX_PRIME) if primes[i]] return p_list p_list def is_prime(n, prime_list):
    sqrt_n = int(n ** 0.5)
    for i in prime_list:
        if i > sqrt_n:
            break
        if n % i == 0:
            return False
    return True is_prime sqrt_n = int(n ** 0.5) sqrt_n int(n ** 0.5) int n ** 0.5 n 0.5 for i in prime_list:
        if i > sqrt_n:
            break
        if n % i == 0:
            return False
     i prime_list if i > sqrt_n:
            break
         i > sqrt_n i sqrt_n break if n % i == 0:
            return False
     n % i == 0 n % i n i 0 return False False return True True n n prime_list prime_list p_list = prime_list() p_list prime_list() prime_list n = int(sys.stdin.readline()) n int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline num_p = 0 num_p 0 for i in range(n):
    x = int(sys.stdin.readline())
    if is_prime(x, p_list):
        num_p += 1 i range(n) range n x = int(sys.stdin.readline()) x int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline if is_prime(x, p_list):
        num_p += 1 is_prime(x, p_list) is_prime x p_list num_p += 1 num_p 1 print(num_p) print num_p def prime_list():
    sqrt_max = int(MAX_PRIME ** 0.5)
    primes = [True for i in range(MAX_PRIME+1)]
    primes[0] = primes[1] = False

    for p in range(sqrt_max):
        if primes[p]:
            for px in range(p*2, MAX_PRIME, p):
                primes[px] = False

    p_list = [i for i in range(MAX_PRIME) if primes[i]]
    return p_list def prime_list():
    sqrt_max = int(MAX_PRIME ** 0.5)
    primes = [True for i in range(MAX_PRIME+1)]
    primes[0] = primes[1] = False

    for p in range(sqrt_max):
        if primes[p]:
            for px in range(p*2, MAX_PRIME, p):
                primes[px] = False

    p_list = [i for i in range(MAX_PRIME) if primes[i]]
    return p_list prime_list MAX_PRIME = 10**4 10**4 MAX_PRIME def is_prime(n, prime_list):
    sqrt_n = int(n ** 0.5)
    for i in prime_list:
        if i > sqrt_n:
            break
        if n % i == 0:
            return False
    return True def is_prime(n, prime_list):
    sqrt_n = int(n ** 0.5)
    for i in prime_list:
        if i > sqrt_n:
            break
        if n % i == 0:
            return False
    return True is_prime p_list = prime_list() prime_list() p_list num_p = 0 0 num_p num_p += 1 1 num_p x = int(sys.stdin.readline()) int(sys.stdin.readline()) x n = int(sys.stdin.readline()) int(sys.stdin.readline()) n
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

MAX_PRIME = 10**4
def prime_list():
    sqrt_max = int(MAX_PRIME ** 0.5)
    primes = [True for i in range(MAX_PRIME+1)]
    primes[0] = primes[1] = False

    for p in range(sqrt_max):
        if primes[p]:
            for px in range(p*2, MAX_PRIME, p):
                primes[px] = False

    p_list = [i for i in range(MAX_PRIME) if primes[i]]
    return p_list


def is_prime(n, prime_list):
    sqrt_n = int(n ** 0.5)
    for i in prime_list:
        if i > sqrt_n:
            break
        if n % i == 0:
            return False
    return True

p_list = prime_list()

n = int(sys.stdin.readline())
num_p = 0

for i in range(n):
    x = int(sys.stdin.readline())
    if is_prime(x, p_list):
        num_p += 1
print(num_p)

