#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vb = vector<bool>;
using vvb = vector<vb>;
using vi = vector<ll>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using pii = pair<ll, ll>;
using pll = pair<ll, ll>;
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1e9 + 7;
void cioacc() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}
pair<vl, vb> eratosthenes_sieve(ll n) {
  vb is_prime(n + 1, true);
  vl prime;
  is_prime[0] = false;
  is_prime[1] = false;
  for (ll i = (2); i < (ll)(n + 1); ++i) {
    if (!is_prime[i]) continue;
    for (ll j = 2 * i; j <= n; j += i) is_prime[j] = false;
    prime.emplace_back(i);
  }
  return {prime, is_prime};
}
signed main() {
  ll n;
  cin >> n;
  vb isp = eratosthenes_sieve(1e8).second;
  ll ans = 0;
  for (ll i = (0); i < (ll)(n); ++i) {
    ll a;
    cin >> a;
    if (isp[a]) ans++;
  }
  cout << ans << endl;
}
