def is_prime(x)
  return true if x === 2 || x === 3
  2.upto(Math.sqrt(x) + 1) do |i|
    return false if x % i === 0
  end
  true
end

def solve(items)
  items.select {|x| is_prime(x) }.count
end
puts solve(Array.new(gets.to_i) { gets.to_i })

