import math

num = raw_input()
num_list = []
for i in range(int(num)):
    a = raw_input()
    num_list.append(int(a))
count = 0

for num in num_list:
    if num <= 1:
        continue
    elif num == 2:
        count += 1
    elif num % 2 == 0:
        continue
    else:
        count += 1
        for i in range(3, int(math.sqrt(num))+1, 2):
            if num % i == 0:
                count -= 1
                break
print count import math math num = raw_input() num raw_input() raw_input num_list = [] num_list [] for i in range(int(num)):
    a = raw_input()
    num_list.append(int(a)) i range(int(num)) range int(num) int num a = raw_input() a raw_input() raw_input num_list.append(int(a)) num_list.append num_list append int(a) int a count = 0 count 0 for num in num_list:
    if num <= 1:
        continue
    elif num == 2:
        count += 1
    elif num % 2 == 0:
        continue
    else:
        count += 1
        for i in range(3, int(math.sqrt(num))+1, 2):
            if num % i == 0:
                count -= 1
                break num num_list if num <= 1:
        continue
    elif num == 2:
        count += 1
    elif num % 2 == 0:
        continue
    else:
        count += 1
        for i in range(3, int(math.sqrt(num))+1, 2):
            if num % i == 0:
                count -= 1
                break num <= 1 num 1 continue elif num == 2:
        count += 1
     num == 2 num 2 count += 1 count 1 elif num % 2 == 0:
        continue
     num % 2 == 0 num % 2 num 2 0 continue count += 1 count 1 for i in range(3, int(math.sqrt(num))+1, 2):
            if num % i == 0:
                count -= 1
                break i range(3, int(math.sqrt(num))+1, 2) range 3 int(math.sqrt(num))+1 int(math.sqrt(num)) int math.sqrt(num) math.sqrt math sqrt num 1 2 if num % i == 0:
                count -= 1
                break num % i == 0 num % i num i 0 count -= 1 count 1 break print count += 1 1 count count += 1 1 count num = raw_input() raw_input() num a = raw_input() raw_input() a count -= 1 1 count count = 0 0 count num_list = [] [] num_list
import math

num = raw_input()
num_list = []
for i in range(int(num)):
    a = raw_input()
    num_list.append(int(a))
count = 0

for num in num_list:
    if num <= 1:
        continue
    elif num == 2:
        count += 1
    elif num % 2 == 0:
        continue
    else:
        count += 1
        for i in range(3, int(math.sqrt(num))+1, 2):
            if num % i == 0:
                count -= 1
                break
print count