#!/usr/bin/env python3
from itertools import count, takewhile


def prime():
    prime = []

    def _isPrime(n):
        for d in takewhile(lambda x: x * x <= n, prime):
            if n % d == 0:
                return False
        return True
    for i in count(2):
        if _isPrime(i):
            prime.append(i)
            yield(i)


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

primes = list(takewhile(lambda x: x < 10000, prime()))

n = int(input())
c = 0
for _ in range(n):
    i = int(input())
    if is_prime(primes, i):
        c += 1
print(c) from itertools import count, takewhile def prime():
    prime = []

    def _isPrime(n):
        for d in takewhile(lambda x: x * x <= n, prime):
            if n % d == 0:
                return False
        return True
    for i in count(2):
        if _isPrime(i):
            prime.append(i)
            yield(i) prime prime = [] prime [] def _isPrime(n):
        for d in takewhile(lambda x: x * x <= n, prime):
            if n % d == 0:
                return False
        return True
     _isPrime for d in takewhile(lambda x: x * x <= n, prime):
            if n % d == 0:
                return False
         d takewhile(lambda x: x * x <= n, prime) takewhile lambda x: x * x <= n x * x <= n x * x x x n x prime if n % d == 0:
                return False
         n % d == 0 n % d n d 0 return False False return True True n n for i in count(2):
        if _isPrime(i):
            prime.append(i)
            yield(i) i count(2) count 2 if _isPrime(i):
            prime.append(i)
            yield(i) _isPrime(i) _isPrime i prime.append(i) prime.append prime append i yield(i) i def is_prime(primes, i):
    for p in takewhile(lambda x: x * x <= i, sorted(primes)):
        if i % p == 0:
            return False
    return True is_prime 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 primes = list(takewhile(lambda x: x < 10000, prime())) primes list(takewhile(lambda x: x < 10000, prime())) list takewhile(lambda x: x < 10000, prime()) takewhile lambda x: x < 10000 x < 10000 x 10000 x prime() prime 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 i = int(input()) int(input()) i c += 1 1 c n = int(input()) int(input()) n c = 0 0 c def prime():
    prime = []

    def _isPrime(n):
        for d in takewhile(lambda x: x * x <= n, prime):
            if n % d == 0:
                return False
        return True
    for i in count(2):
        if _isPrime(i):
            prime.append(i)
            yield(i) def prime():
    prime = []

    def _isPrime(n):
        for d in takewhile(lambda x: x * x <= n, prime):
            if n % d == 0:
                return False
        return True
    for i in count(2):
        if _isPrime(i):
            prime.append(i)
            yield(i) prime primes = list(takewhile(lambda x: x < 10000, prime())) list(takewhile(lambda x: x < 10000, prime())) primes def is_prime(primes, i):
    for p in takewhile(lambda x: x * x <= i, sorted(primes)):
        if i % p == 0:
            return False
    return True def is_prime(primes, i):
    for p in takewhile(lambda x: x * x <= i, sorted(primes)):
        if i % p == 0:
            return False
    return True is_prime
#!/usr/bin/env python3
from itertools import count, takewhile


def prime():
    prime = []

    def _isPrime(n):
        for d in takewhile(lambda x: x * x <= n, prime):
            if n % d == 0:
                return False
        return True
    for i in count(2):
        if _isPrime(i):
            prime.append(i)
            yield(i)


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

primes = list(takewhile(lambda x: x < 10000, prime()))

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