def isPrime(n)
  if n < 2 then
    return false
  elsif n == 2 then
    return true
  end

  if n % 2 == 0 then
    return false
  end

  3.step(n, 2){|i|
    if i > n/i then
      return true
    elsif (n % i) == 0 then
      return false
    end
  }

end

### main ###
length = STDIN.gets.to_s.to_i

count = 0
for i in 1..length do
  if isPrime(STDIN.gets.to_s.to_i) then
    count = count + 1
  end
end

p count