#include <bits/stdc++.h>
using namespace std;
bitset<100000010> prime;
void m_pList() {
  prime.set();
  prime[0] = prime[1] = prime[2] = 0;
  for (long long i = 3; i * i < 100000010; i++) {
    if (i % 2 == 0) {
      prime[i] = 0;
    } else if (prime[i]) {
      for (long long j = i * 2; j < 100000010; j += i) {
        prime[j] = 0;
      }
    }
  }
}
int main() {
  m_pList();
  int ans = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int tmp;
    cin >> tmp;
    ans += prime[tmp];
  }
  cout << ans << endl;
}
