#include <bits/stdc++.h>
using namespace std;
int main(void) {
  char prime[100000001];
  int N, inp, cnt = 0;
  for (int i = 0; i < 100000001; i++) prime[i] = 'Y';
  prime[0] = 'N', prime[1] = 'N';
  for (int i = 0; i < 100000001; i++) {
    if (prime[i] == 'Y') {
      for (int j = i * 2; j < 100000001; j += i) {
        prime[j] = 'N';
      }
    }
  }
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> inp;
    if (prime[inp] == 'Y') cnt++;
  }
  cout << cnt << endl;
  return 0;
}
