#include <bits/stdc++.h>
using namespace std;
int table[100000001];
void prim() {
  table[0] = table[1] = 1;
  for (int i = 2; i * i < 100000001; i++) {
    for (int j = 2 * i; j < 100000001; j += i) {
      table[j] = 1;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  prim();
  int n;
  cin >> n;
  int cou = 0, a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (!table[a]) cou++;
  }
  cout << cou << endl;
}
