#include <bits/stdc++.h>
using namespace std;
int a[10001];
bool prime_table[10000001];
int max_a = 0;
void make_prime_table() {
  for (int i = 0; i <= max_a; i++) prime_table[i] = true;
  prime_table[0] = prime_table[1] = false;
  for (int i = 2; i <= max_a; i++) {
    if (prime_table[i]) {
      for (int j = 2 * i; j <= max_a; j += i) prime_table[j] = false;
    }
  }
  return;
}
void solve(int n) {
  make_prime_table();
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (prime_table[a[i]]) count++;
  }
  cout << count << endl;
  return;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    max_a = max(max_a, a[i]);
  }
  solve(n);
  return 0;
}
