
count = gets.to_i
arr = []

count.times do
  arr << gets.to_i
end

arr.each do |number|
  next if number == 1
  sqrt = Math.sqrt(number)
  factor_found = (2..sqrt).any? { |int| number % int == 0 }

  unless factor_found
    arr << number
  end
end

p arr.count