#!/usr/bin/ruby
# -*- coding: utf-8 -*-
require "prime"
class Main
  def initialize
    fh = STDIN
    n = fh.gets.chomp.to_i
    count=0
    (1..n).each {|i|
      p = fh.gets.chomp.to_i
      if Prime.prime?(p) then
        count += 1
      end
    }
    puts count
  end
end

if $0==__FILE__ then
  Main.new()
end