#include <bits/stdc++.h>
using namespace std;
void Solution() {
  long int n = 100010;
  bool a[n];
  int N;
  int b;
  int count = 0;
  cin >> N;
  for (int i = 2; i <= n; i++) {
    if (i % 2 == 0) {
      a[i] = false;
    } else {
      a[i] = true;
    }
  }
  a[1] = false;
  a[2] = true;
  for (int i = 3; i <= n; i += 2) {
    if (a[i]) {
      for (int j = i + i; j * j <= n; j += i) {
        a[j] = false;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    cin >> b;
    if (a[b]) {
      count++;
    }
  }
  cout << count << endl;
}
int main() {
  Solution();
  return 0;
}
