n = gets(chomp:true).to_i


n.times do
nums << gets(chomp:true).to_i
end

count = 0

nums = []

nums.each do |num|

  num != 2 && num.even? && next

  if num == 2 
    count += 1
    next 
  end

  flag = true
  (2..Integer.sqrt(num)).each do |sqrtnum|
    sqrtnum == 0 && next
    if num % sqrtnum == 0
      flag = false
    end
  end

   flag && count += 1
  
end

puts count
