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