#include <bits/stdc++.h>
using namespace std;
int primes[10000];
int to_i(const string& num) {
  int res = 0;
  for (int i = 0; i < num.size(); ++i) {
    res = res * 10 + (num[i] - '0');
  }
  return res;
}
int main(void) {
  int N;
  cin >> N;
  int total = 0;
  for (int i = 0; i < N; ++i) {
    string num;
    cin >> num;
    bool ok = true;
    for (int j = 2, n = to_i(num); j < n; ++j) {
      if (to_i(num) % j == 0) {
        ok = false;
        break;
      }
    }
    if (ok) ++total;
  }
  printf("%d\n", total);
  return 0;
}
