def prime(array)
  counter = 0
  divisible = []
  array.each do |item|
    for i in 1..item
      if(item % i == 0)
        divisible << i
      end
    end
    if(divisible.length == 2)
      counter += 1
    end
    divisible = []
  end
  puts counter
end

a = []
n = gets.chomp

for j in 0..n.to_i-1
  a << gets.chomp.to_i
end

prime(a)