#!/usr/bin/env python3
from itertools import takewhile
from math import sqrt


def is_prime(primes, i):
    if i in primes:
        return True
    for p in takewhile(lambda x: x * x <= i, sorted(primes)):
        if i % p == 0:
            return False
    return True


def sieve_of_eratosthenes(max):
    is_prime = [True] * (max + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(sqrt(max)) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * i, max + 1, i):
            is_prime[j] = False
    return filter(lambda x: is_prime[x], range(max + 1))

primes = set(sieve_of_eratosthenes(10000))

n = int(input())
c = 0
for _ in range(n):
    i = int(input())
    if is_prime(primes, i):
        c += 1
print(c) from itertools import takewhile from math import sqrt def is_prime(primes, i):
    if i in primes:
        return True
    for p in takewhile(lambda x: x * x <= i, sorted(primes)):
        if i % p == 0:
            return False
    return True is_prime if i in primes:
        return True
     i in primes i primes return True True for p in takewhile(lambda x: x * x <= i, sorted(primes)):
        if i % p == 0:
            return False
     p takewhile(lambda x: x * x <= i, sorted(primes)) takewhile lambda x: x * x <= i x * x <= i x * x x x i x sorted(primes) sorted primes if i % p == 0:
            return False
     i % p == 0 i % p i p 0 return False False return True True primes primes i i def sieve_of_eratosthenes(max):
    is_prime = [True] * (max + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(sqrt(max)) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * i, max + 1, i):
            is_prime[j] = False
    return filter(lambda x: is_prime[x], range(max + 1)) sieve_of_eratosthenes is_prime = [True] * (max + 1) is_prime [True] * (max + 1) [True] True max + 1 max 1 is_prime[0] = False is_prime[0] is_prime 0 False is_prime[1] = False is_prime[1] is_prime 1 False for i in range(2, int(sqrt(max)) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * i, max + 1, i):
            is_prime[j] = False
     i range(2, int(sqrt(max)) + 1) range 2 int(sqrt(max)) + 1 int(sqrt(max)) int sqrt(max) sqrt max 1 if not is_prime[i]:
            continue
         not is_prime[i] is_prime[i] is_prime i continue for j in range(i * i, max + 1, i):
            is_prime[j] = False
     j range(i * i, max + 1, i) range i * i i i max + 1 max 1 i is_prime[j] = False is_prime[j] is_prime j False return filter(lambda x: is_prime[x], range(max + 1)) filter(lambda x: is_prime[x], range(max + 1)) filter lambda x: is_prime[x] is_prime[x] is_prime x x range(max + 1) range max + 1 max 1 max max primes = set(sieve_of_eratosthenes(10000)) primes set(sieve_of_eratosthenes(10000)) set sieve_of_eratosthenes(10000) sieve_of_eratosthenes 10000 n = int(input()) n int(input()) int input() input c = 0 c 0 for _ in range(n):
    i = int(input())
    if is_prime(primes, i):
        c += 1 _ range(n) range n i = int(input()) i int(input()) int input() input if is_prime(primes, i):
        c += 1 is_prime(primes, i) is_prime primes i c += 1 c 1 print(c) print c primes = set(sieve_of_eratosthenes(10000)) set(sieve_of_eratosthenes(10000)) primes def is_prime(primes, i):
    if i in primes:
        return True
    for p in takewhile(lambda x: x * x <= i, sorted(primes)):
        if i % p == 0:
            return False
    return True def is_prime(primes, i):
    if i in primes:
        return True
    for p in takewhile(lambda x: x * x <= i, sorted(primes)):
        if i % p == 0:
            return False
    return True is_prime c = 0 0 c i = int(input()) int(input()) i c += 1 1 c n = int(input()) int(input()) n def sieve_of_eratosthenes(max):
    is_prime = [True] * (max + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(sqrt(max)) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * i, max + 1, i):
            is_prime[j] = False
    return filter(lambda x: is_prime[x], range(max + 1)) def sieve_of_eratosthenes(max):
    is_prime = [True] * (max + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(sqrt(max)) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * i, max + 1, i):
            is_prime[j] = False
    return filter(lambda x: is_prime[x], range(max + 1)) sieve_of_eratosthenes
#!/usr/bin/env python3
from itertools import takewhile
from math import sqrt


def is_prime(primes, i):
    if i in primes:
        return True
    for p in takewhile(lambda x: x * x <= i, sorted(primes)):
        if i % p == 0:
            return False
    return True


def sieve_of_eratosthenes(max):
    is_prime = [True] * (max + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(sqrt(max)) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * i, max + 1, i):
            is_prime[j] = False
    return filter(lambda x: is_prime[x], range(max + 1))

primes = set(sieve_of_eratosthenes(10000))

n = int(input())
c = 0
for _ in range(n):
    i = int(input())
    if is_prime(primes, i):
        c += 1
print(c)