#include <bits/stdc++.h>
using namespace std;
bool is[10000001];
int main() {
  for (int i = 0; i < 10000001; i++) is[i] = true;
  is[0] = is[1] = 0;
  for (int i = 2; i < 10000001; i++) {
    if (is[i]) {
      for (int j = 2; i * j < 10000001; j++) {
        is[i * j] = false;
      }
    }
  }
  int n, p, ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> p;
    if (is[p]) ans++;
  }
  cout << ans << endl;
  return 0;
}
