require 'prime'

n = gets.chomp.to_i
i, count = 0, 0
arr = []

n.times{
  a = gets.chomp.to_i
  if a != 2 && a.even?
    next
  else
    arr[i] = a
    i += 1
  end
}

arr.each{ |j|
  Prime.prime?(j) == true && count += 1
}

puts count