import sys

num_list = []

for line in sys.stdin.readlines():
    num_list.append(int(line.strip()))

num_list.remove(num_list[0])

count = 0

for num in num_list:
    if num != 1:
        for i in range(2, num-1):
            if num % i == 0:
                continue
    count += 1

print count