#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAX = (int)1e8;
bool prime[MAX + 1];
int main() {
  fill(prime, prime + MAX + 1, 1);
  for (int i = 2; i <= MAX; i++) {
    if (prime[i]) {
      for (int k = 2; i * k <= MAX; k++) {
        prime[i * k] = 0;
      }
    }
  }
  int n;
  int a;
  int cnt = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    cnt += prime[a];
  }
  cout << cnt << endl;
}
