#include <bits/stdc++.h>
using namespace std;
const long long int N = 100000000;
bool prime[N + 1];
void solve() {
  fill(prime, prime + N + 1, true);
  prime[0] = false;
  prime[1] = false;
  for (int i = 2; i < N + 1; i++)
    if (prime[i])
      for (int j = 2 * i; j < N + 1; j += i) prime[j] = false;
}
int main() {
  solve();
  int n, cnt = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a = 0;
    cin >> a;
    if (prime[a]) cnt++;
  }
  cout << cnt << endl;
  return 0;
}
