#include <bits/stdc++.h>
using namespace std;
int n;
int c = 0;
int a[10000];
int b[100000000];
int main() {
  cin >> n;
  b[0] = 1;
  b[1] = 1;
  for (int i = 2; i < 100000000; i++) {
    b[i] = 1;
  }
  for (int i = 2; i < 10000; i++) {
    if (b[i] == 1) {
      for (int j = 2; j < 10000; j++) b[i * j] = -1;
    }
  }
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    if (b[a[i]] == 1) {
      c++;
    }
  }
  cout << c << endl;
  return 0;
}
