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