#include <bits/stdc++.h>
using namespace std;
int isPrime[10005];
void eratos(int n) {
  int j;
  for (int i = 0; i <= n; i++) isPrime[i] = 1;
  isPrime[0] = 0, isPrime[1] = 0;
  for (int i = 2; i <= n; i++) {
    if (isPrime[i]) {
      j = i + i;
      while (j <= n) {
        isPrime[j] = 0;
        j = j + i;
      }
    }
  }
}
int main() {
  int n, a, sum = 0, p[10005], k = 0;
  cin >> n;
  eratos(10005);
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (isPrime[a]) sum++;
  }
  cout << sum << endl;
  return 0;
}
