import math

numbers = []
n = raw_input()
for i in range(int(n)):
    input_num = raw_input()
    numbers.append(int(input_num))

count = 0
for num in numbers:
    prime_frag = True
    for i in range(2, int(math.sqrt(num)) + 1):
        if num % i == 0:
            prime_frag = False
            break
    if prime_frag:
        count += 1
print count import math math numbers = [] numbers [] n = raw_input() n raw_input() raw_input for i in range(int(n)):
    input_num = raw_input()
    numbers.append(int(input_num)) i range(int(n)) range int(n) int n input_num = raw_input() input_num raw_input() raw_input numbers.append(int(input_num)) numbers.append numbers append int(input_num) int input_num count = 0 count 0 for num in numbers:
    prime_frag = True
    for i in range(2, int(math.sqrt(num)) + 1):
        if num % i == 0:
            prime_frag = False
            break
    if prime_frag:
        count += 1 num numbers prime_frag = True prime_frag True for i in range(2, int(math.sqrt(num)) + 1):
        if num % i == 0:
            prime_frag = False
            break
     i range(2, int(math.sqrt(num)) + 1) range 2 int(math.sqrt(num)) + 1 int(math.sqrt(num)) int math.sqrt(num) math.sqrt math sqrt num 1 if num % i == 0:
            prime_frag = False
            break
     num % i == 0 num % i num i 0 prime_frag = False prime_frag False break if prime_frag:
        count += 1 prime_frag count += 1 count 1 print numbers = [] [] numbers input_num = raw_input() raw_input() input_num prime_frag = True True prime_frag count += 1 1 count count = 0 0 count n = raw_input() raw_input() n prime_frag = False False prime_frag
import math

numbers = []
n = raw_input()
for i in range(int(n)):
    input_num = raw_input()
    numbers.append(int(input_num))

count = 0
for num in numbers:
    prime_frag = True
    for i in range(2, int(math.sqrt(num)) + 1):
        if num % i == 0:
            prime_frag = False
            break
    if prime_frag:
        count += 1
print count