from math import sqrt

n = int(input())
maximum = 0
given_numbers = dict()
for i in range(n):
    num = int(input())
    if num > maximum:
        maximum = num
    given_numbers[num] = None

def eratosthenes(n):
    root = sqrt(n)
    #print(root)
    nums = []
    for i in range(2,n+1):
        nums.append(i)
    primes = []
    while nums[0] < root:
        for i in nums:
            if i != nums[0] and i % nums[0] == 0:
                nums.remove(i)
        primes.append(nums[0])
        nums.remove(nums[0])
    primes += nums
    return primes

def count_primes(dic, max):
    primes = eratosthenes(max)
    #print(primes)
    count = 0
    for num in dic:
        if num in primes:
            count += 1
    return count

print(count_primes(given_numbers, maximum))