#include <bits/stdc++.h>
using namespace std;
bool prime[100000001];
int main() {
  int endi = (int)sqrt(100000000);
  for (int i = 2; i <= endi; i++) {
    if (!prime[i]) {
      for (int j = i + i; j <= 100000000; j += i) {
        prime[j] = true;
      }
    }
  }
  int n, count = 0;
  cin >> n;
  while (n--) {
    int k;
    cin >> k;
    if (!prime[k]) count++;
  }
  cout << count << endl;
  return 0;
}
