import sys


def sieve(N):
    is_prime = [True] * (N + 1)
    prime_list = []
    
    is_prime[0] = is_prime[1] = False
    
    prime_list.append(2)
    for i in range(3, N + 1, 2):
        if is_prime[i]:
            prime_list.append(i)
        for j in range(i * i, N, i):
            is_prime[j] = False
    
    return prime_list
    
primes = sieve(10001)
primes_set = set(primes)

def is_prime(num):
    if num in primes_set:
        return True
    elif num <= 10000:
        return False
    else:
        for prime in primes:
            if num % prime == 0:
                return False
        return True
    
if __name__ == '__main__':
    N = sys.stdin.readline()
    N = int(N)
    ans = 0
    for i in range(N):
        num = sys.stdin.readline()
        num = int(num)
        if is_prime(num): ans += 1
    
    sys.stdout.write(str(ans) + '\n') import sys sys def sieve(N):
    is_prime = [True] * (N + 1)
    prime_list = []
    
    is_prime[0] = is_prime[1] = False
    
    prime_list.append(2)
    for i in range(3, N + 1, 2):
        if is_prime[i]:
            prime_list.append(i)
        for j in range(i * i, N, i):
            is_prime[j] = False
    
    return prime_list
     sieve is_prime = [True] * (N + 1) is_prime [True] * (N + 1) [True] True N + 1 N 1 prime_list = [] prime_list [] is_prime[0] = is_prime[1] = False is_prime[0] is_prime 0 False = is_prime[1] = False is_prime[1] is_prime 1 False prime_list.append(2) prime_list.append prime_list append 2 for i in range(3, N + 1, 2):
        if is_prime[i]:
            prime_list.append(i)
        for j in range(i * i, N, i):
            is_prime[j] = False
    
     i range(3, N + 1, 2) range 3 N + 1 N 1 2 if is_prime[i]:
            prime_list.append(i)
         is_prime[i] is_prime i prime_list.append(i) prime_list.append prime_list append i for j in range(i * i, N, i):
            is_prime[j] = False
    
     j range(i * i, N, i) range i * i i i N i is_prime[j] = False is_prime[j] is_prime j False return prime_list prime_list N N primes = sieve(10001) primes sieve(10001) sieve 10001 primes_set = set(primes) primes_set set(primes) set primes def is_prime(num):
    if num in primes_set:
        return True
    elif num <= 10000:
        return False
    else:
        for prime in primes:
            if num % prime == 0:
                return False
        return True
     is_prime if num in primes_set:
        return True
    elif num <= 10000:
        return False
    else:
        for prime in primes:
            if num % prime == 0:
                return False
        return True
     num in primes_set num primes_set return True True elif num <= 10000:
        return False
     num <= 10000 num 10000 return False False for prime in primes:
            if num % prime == 0:
                return False
         prime primes if num % prime == 0:
                return False
         num % prime == 0 num % prime num prime 0 return False False return True True num num if __name__ == '__main__':
    N = sys.stdin.readline()
    N = int(N)
    ans = 0
    for i in range(N):
        num = sys.stdin.readline()
        num = int(num)
        if is_prime(num): ans += 1
    
    sys.stdout.write(str(ans) + '\n') __name__ == '__main__' __name__ '__main__' N = sys.stdin.readline() N sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline N = int(N) N int(N) int N ans = 0 ans 0 for i in range(N):
        num = sys.stdin.readline()
        num = int(num)
        if is_prime(num): ans += 1
    
     i range(N) range N num = sys.stdin.readline() num sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline num = int(num) num int(num) int num if is_prime(num): ans += 1
    
     is_prime(num) is_prime num sys.stdout.write(str(ans) + '\n') sys.stdout.write sys.stdout sys stdout write str(ans) + '\n' str(ans) str ans '\n' primes = sieve(10001) sieve(10001) primes ans = 0 0 ans num = int(num) int(num) num N = sys.stdin.readline() sys.stdin.readline() N N = int(N) int(N) N primes_set = set(primes) set(primes) primes_set num = sys.stdin.readline() sys.stdin.readline() num def is_prime(num):
    if num in primes_set:
        return True
    elif num <= 10000:
        return False
    else:
        for prime in primes:
            if num % prime == 0:
                return False
        return True
     def is_prime(num):
    if num in primes_set:
        return True
    elif num <= 10000:
        return False
    else:
        for prime in primes:
            if num % prime == 0:
                return False
        return True
     is_prime def sieve(N):
    is_prime = [True] * (N + 1)
    prime_list = []
    
    is_prime[0] = is_prime[1] = False
    
    prime_list.append(2)
    for i in range(3, N + 1, 2):
        if is_prime[i]:
            prime_list.append(i)
        for j in range(i * i, N, i):
            is_prime[j] = False
    
    return prime_list
     def sieve(N):
    is_prime = [True] * (N + 1)
    prime_list = []
    
    is_prime[0] = is_prime[1] = False
    
    prime_list.append(2)
    for i in range(3, N + 1, 2):
        if is_prime[i]:
            prime_list.append(i)
        for j in range(i * i, N, i):
            is_prime[j] = False
    
    return prime_list
     sieve
import sys


def sieve(N):
    is_prime = [True] * (N + 1)
    prime_list = []
    
    is_prime[0] = is_prime[1] = False
    
    prime_list.append(2)
    for i in range(3, N + 1, 2):
        if is_prime[i]:
            prime_list.append(i)
        for j in range(i * i, N, i):
            is_prime[j] = False
    
    return prime_list
    
primes = sieve(10001)
primes_set = set(primes)

def is_prime(num):
    if num in primes_set:
        return True
    elif num <= 10000:
        return False
    else:
        for prime in primes:
            if num % prime == 0:
                return False
        return True
    
if __name__ == '__main__':
    N = sys.stdin.readline()
    N = int(N)
    ans = 0
    for i in range(N):
        num = sys.stdin.readline()
        num = int(num)
        if is_prime(num): ans += 1
    
    sys.stdout.write(str(ans) + '\n')