#!/usr/bin/ruby

N = $stdin.gets.chomp;

num_of_prime=0;
primes  = [2];
list  = [];
while num = $stdin.gets do
  list.push(num.chomp.to_i)
end

list = list.sort

2.step(list[list.length-1], 1) do |i|
  not_prime = 0;
  primes.each do |prime|
    if i < prime * prime then
      break
    end
    if i % prime == 0 then
      not_prime=1;
      break
    end
  end
  if not_prime == 0 then
    primes.push(i);
    if i >= list[0] && list.index(i) != nil then
      num_of_prime+=1
    end
  end
end

print num_of_prime.to_s + "\n"