#include <bits/stdc++.h>
using namespace std;
class c_primeNumber {
 private:
  int n;
  int x[10000];

 public:
  void f_primeNumber1();
  int f_primeNumber2(int x);
};
void c_primeNumber::f_primeNumber1() {
  int i;
  int c = 0;
  cin >> n;
  for (i = 0; i < n; ++i) {
    cin >> x[i];
    if (x[i] == 2) {
      c = c + 1;
    } else {
      if ((x[i] % 2) != 0) {
        if (c_primeNumber::f_primeNumber2(x[i]) == 0) {
          c = c + 1;
        }
      }
    }
  }
  cout << c << endl;
}
int c_primeNumber::f_primeNumber2(int x) {
  int i;
  for (i = 2; i < x; ++i) {
    if (x % i == 0) return 1;
  }
  return 0;
}
int main() {
  c_primeNumber primeNumber01;
  primeNumber01.f_primeNumber1();
  return 0;
}
