#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long primes[10100];
  for (long long i = 2; i < 10100; i++) {
    if (primes[i] == 0) continue;
    primes[i] = 1;
    for (long long j = i * 2; j < 10100; j += i) {
      primes[j] = 0;
    }
  }
  long long N, ans = 0;
  cin >> N;
  for (long long i = 0; i < N; i++) {
    long long t;
    cin >> t;
    ans += primes[t];
  }
  cout << ans << endl;
}
