# coding: UTF-8
n = int(raw_input())
count = 0
for i in range(n):
    break_f = False
    j = 3
    num = int(raw_input())
    if (num < 2):
        continue
    elif (num == 2):
        count += 1
        continue
    elif (num % 2 == 0):
        continue
    while j < num:
        if (num % j == 0):
            j += 2
            break_f = True
            break
        j += 2
    if break_f == True:
        continue
    count += 1
print(count)

