#include <bits/stdc++.h>
using namespace std;
int prime[100000002];
void seive() {
  memset(prime, 1, sizeof(prime));
  prime[0] = 0;
  prime[1] = 0;
  for (int i = 0; i * i <= 100000002; i++) {
    if (prime[i]) {
      for (int j = 2 * i; j < 100000002; j += i) prime[j] = 0;
    }
  }
}
int check_prime(int num) {
  if (num == 2) return 1;
  if (!num & 1)
    return 0;
  else
    return prime[num];
}
int main() {
  int n;
  cin >> n;
  int num[n];
  int prime_cnt = 0;
  seive();
  for (int i = 0; i < n; ++i) {
    cin >> num[i];
    if (check_prime(num[i])) prime_cnt++;
  }
  cout << prime_cnt << endl;
  return 0;
}
