def seive(num):
    nums = [1] * num
    nums[0], nums[1] = 0, 1
    for i in range(1, int(num ** 0.5) + 1):
        if nums[i-1] == 0:
            continue
        else:
            j = i * 2
            while j <= num:
                nums[j-1] = 0
                j += i

    res = []
    for n in range(len(nums)):
        if nums[n] == 1:
            res.append(n + 1)
    return res

n = int(input())
nums = []
for i in range(n):
    nums.append(int(input()))

res = seive(max(nums))
ans = 0
for n in nums:
    if n in res:
        ans += 1

print(ans)