class String
  def to_ia
    self.split(/\s+/).map {|s| s.to_i}
  end
end
 
def is_prime(x)
  return true if x == 2
  return false if x < 2 or x % 2 == 0
  i = 3
  while i <= Math.sqrt(x).ceil
    return false if x % i == 0
    i += 2
  end
  true
end
 
lines = STDIN.read.split(/\n/)
numbers = lines[1..-1].map {|l| l.to_i}
puts numbers.select {|n| is_prime(n)}.size