def is_prime(n)
  return 0 if n < 2
  return 1 if n == 2
  return 0 if n % 2 == 0
  i = 3;
  while i <= Math.sqrt(n)
    return 0 if n % i == 0
    i += 2
  end
  return 1
end

n = gets.to_i

count = 0
n.times{
  count += is_prime(gets.to_i)
}
printf "%d\n", count