MODE = "stdiro"
#require 'matrix'
#include Math
line = Array.new

if(defined? MODE)
  line = STDIN.read.split("\n")
else
  tmp = '6
  2
  3
  4
  5
  6
  7'.split("\n")
  tmp.each{|s|
    line << s.strip
  }
end
def isprime?(x)
  if x==2
    return true
  elsif x<2 || x%2==0
    return false
  end

  i=3
  while i<=x**0.5
    if x%i==0
      return false
    end
    i+=2
  end
  return true
end


n = line[0].to_i
cnt=0
(1..n).each do |num|
  a = line[num].to_i
  cnt+=1 if isprime?(a)
end

puts cnt