#include <bits/stdc++.h>
using namespace std;
int prime[10000000];
int main() {
  int n, temp;
  int count;
  for (int i = 0; i < 10000000; i++) prime[i] = 1;
  for (int p = 2; p < 5000000; p++) {
    int k = 2;
    while (p * k < 10000000) {
      prime[p * k] = 0;
      k++;
    }
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    if (prime[temp]) count++;
  }
  cout << count << endl;
  return 0;
}
