#include <bits/stdc++.h>
class PrimeNumbers {
 private:
  std::vector<int> dataSet;
  bool isPrimeNumber(int x);

 public:
  PrimeNumbers(std::vector<int> vec);
  int getPrimeCount();
};
PrimeNumbers::PrimeNumbers(std::vector<int> vec) { this->dataSet = vec; }
bool PrimeNumbers::isPrimeNumber(int x) {
  for (int i = 2; i < x; i++) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}
int PrimeNumbers::getPrimeCount() {
  int returnCount = 0;
  for (int i : dataSet) {
    if (isPrimeNumber(i)) {
      returnCount++;
    }
  }
  return returnCount;
}
int main() {
  int loop;
  std::cin >> loop;
  int input;
  std::vector<int> vec;
  for (int i = 0; i < loop; i++) {
    std::cin >> input;
    vec.push_back(input);
  }
  PrimeNumbers pn = PrimeNumbers(vec);
  std::cout << pn.getPrimeCount() << std::endl;
  return 0;
}
