# coding: UTF-8
n = int(raw_input())
count = 0
for i in range(n):
    num = int(raw_input())
    if (num < 2):
        continue
    elif (num == 2):
        count += 1
        continue
    elif (num % 2 == 0):
        continue
    if pow(2,num-1,num) == 1:
        count += 1
print(count)
 n = int(raw_input()) n int(raw_input()) int raw_input() raw_input count = 0 count 0 for i in range(n):
    num = int(raw_input())
    if (num < 2):
        continue
    elif (num == 2):
        count += 1
        continue
    elif (num % 2 == 0):
        continue
    if pow(2,num-1,num) == 1:
        count += 1 i range(n) range n num = int(raw_input()) num int(raw_input()) int raw_input() raw_input if (num < 2):
        continue
    elif (num == 2):
        count += 1
        continue
    elif (num % 2 == 0):
        continue
     num < 2 num 2 continue elif (num == 2):
        count += 1
        continue
     num == 2 num 2 count += 1 count 1 continue elif (num % 2 == 0):
        continue
     num % 2 == 0 num % 2 num 2 0 continue if pow(2,num-1,num) == 1:
        count += 1 pow(2,num-1,num) == 1 pow(2,num-1,num) pow 2 num-1 num 1 num 1 count += 1 count 1 print(count) print count count += 1 1 count count = 0 0 count n = int(raw_input()) int(raw_input()) n num = int(raw_input()) int(raw_input()) num count += 1 1 count
# coding: UTF-8
n = int(raw_input())
count = 0
for i in range(n):
    num = int(raw_input())
    if (num < 2):
        continue
    elif (num == 2):
        count += 1
        continue
    elif (num % 2 == 0):
        continue
    if pow(2,num-1,num) == 1:
        count += 1
print(count)

