def eratosthenes(n)
  prime = []
  limit = Math.sqrt(n)
  d = (2..n).to_a
  while true do
    t = d[0]
    if limit <= t then
      return prime + d
    end
    prime.push(t)
    next_d = []
    d.each { |e|
      if e % t != 0 then
        next_d.push(e)
      end 
    }
    d = next_d
  end
end

def main()
  n = gets.to_i
  a = []
  n.times.each { |i|
    a.push(gets.to_i)
  }
  primes = eratosthenes(10000)
  cnt = 0
  a.each { |e|
    if primes.include?(e) then
      cnt += 1
    end
  }
  puts cnt
end

main

