function check_sosu(number) {
  var lower = Math.floor(Math.sqrt(number));
  if(number == 2) return 1;
  else if(!(number % 2)) return 0
  // for(let i = 2; i <= lower; i++) {
  for(let i = 3; i <= lower; i+=2) {
      if(!(number % i)) {
        return 0;
    }
  }
  return 1;
}
function Main(input) {
  var sosu = 0;
  input = input.split("\n").map(Number);
  var num_array = input.slice(1);
  for(let i = 0; i < Number(input[0]); i++) sosu += check_sosu(num_array[i]);
  console.log(sosu);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

