#include <bits/stdc++.h>
bool isPrime(std::size_t a) {
  if (a == 2) {
    return true;
  } else if (a % 2 == 0) {
    return false;
  }
  for (std::size_t i = 3; i <= (std::size_t)(sqrt(a)); i = i + 2) {
    if (a % i == 0) {
      return false;
    }
  }
  std::cout << a << " is prime" << std::endl;
  return true;
}
int main() {
  std::size_t n;
  std::cin >> n;
  std::size_t count = 0;
  for (std::size_t i = 0; i < n; ++i) {
    std::size_t a;
    std::cin >> a;
    if (isPrime(a)) {
      count++;
    }
  }
  std::cout << count << std::endl;
  return 0;
}
