
def geta(n=0)
  return $stdin.gets.to_i if n==0
  ar = []
  n.times do 
    ar << $stdin.gets.chomp.split
  end
  return ar.flatten(1) if n<=1
  return ar
end

def jadge(n)
  sqrt = Math.sqrt(n).ceil
  2.step(sqrt) do |i|
    return 0 if n%i == 0
  end
  return 1
end

n = geta(0)
ar = geta(n)

cnt = 0
ar.flatten.map(&:to_i).each do |n|
  cnt += 1 if n == 2
  next if n <= 2
  cnt += jadge(n)
end

p cnt
