#include <bits/stdc++.h>
using namespace std;
int prime_number[1229];
bool isPrime(int element) {
  for (int i = 0; prime_number[i] * prime_number[i] <= element; i++) {
    if (element % prime_number[i] == 0) return false;
  }
  return true;
}
void calcPrime() {
  int prime_index = 2;
  prime_number[0] = 2;
  prime_number[1] = 3;
  for (int element = 5; element <= 10000; element += 2) {
    bool is_prime = true;
    for (int i = 1; prime_number[i] * prime_number[i] <= element; i++) {
      if (element % prime_number[i] == 0) {
        is_prime = false;
        break;
      }
    }
    if (is_prime) prime_number[prime_index++] = element;
  }
  return;
}
int main() {
  int n, element, count = 0;
  calcPrime();
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> element;
    if (isPrime(element)) count++;
  }
  cout << count << endl;
  return 0;
}
