#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
class primes_list {
 public:
  primes_list(void) { primes_list(0); }
  primes_list(size_t i) {
    primes.push_back(false);
    primes.push_back(true);
    gen(i);
  }
  bool is_prime(size_t i) {
    if (primes.size() < i) gen(i);
    return primes[i - 1];
  }
  void gen(size_t i) {
    if (primes.size() >= i) return;
    try {
      primes.resize(i, true);
    } catch (std::exception e) {
      cout << "error on memory allocation" << endl;
      throw(e);
    }
    for (size_t j = 2; j < i; j++) {
      if (primes[j - 1]) {
        for (int k = j + j; k <= primes.size(); k += j) {
          primes[k - 1] = false;
        }
      }
    }
  }

 private:
  std::vector<bool> primes;
};
int main() {
  primes_list p(100);
  int n, t, c = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t;
    if (p.is_prime(t)) c++;
  }
  cout << c << endl;
}
