#!/usr/bin/ruby

N = $stdin.gets.chomp;

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

2.step(list[0], 1) do |i|
  not_prime = 0;
  primes.each do |prime|
    if i % prime == 0 then
      not_prime+=1;
    end
  end
  if not_prime == 0 then
    primes.push(i);
  end
end

if primes[primes.length-1] == list[0] then
  num_of_prime+=1;
end

while num = $stdin.gets do
  i = num.chomp.to_i;
  not_prime = 0;
  primes.each do |prime|
    if i != prime && i % prime == 0 then
      not_prime+=1;
    end
  end
  if not_prime == 0 then
    primes.push(i);
    num_of_prime+=1;
  end
end

print(num_of_prime.to_s + "\n");