#include <bits/stdc++.h>
using namespace std;
bool is_prime[10000000];
int primes[100000000];
int prime_count = 0;
void set_prime() {
  int j, end_point;
  bool flag;
  for (int i = 5; i < 100000000; i += 2) {
    flag = false;
    end_point = (int)sqrt((double)i);
    for (j = 0; j < prime_count && primes[j] <= end_point; j++) {
      if (i % primes[j] == 0) {
        flag = true;
        break;
      }
    }
    if (!flag) {
      is_prime[i] = true;
      primes[prime_count++] = i;
    }
  }
}
int main() {
  for (int i = 2; i <= 3; i++) {
    is_prime[i] = true;
    primes[prime_count++] = i;
  }
  set_prime();
  int N, num, count;
  count = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> num;
    if (is_prime[num]) count++;
  }
  cout << count << endl;
  return 0;
}
