#include <bits/stdc++.h>
using namespace std;
int getPrimeNumbers(int max, int prime[]) {
  prime[0] = 2;
  int counter = 0;
  bool isPrime;
  for (int i = 3; prime[counter] * prime[counter] < max + 1; i += 2) {
    isPrime = true;
    for (int j = 0; j <= counter; j++) {
      if (i % prime[j] == 0) isPrime = false;
    }
    if (isPrime) {
      prime[++counter] = i;
    }
  }
  return counter;
}
int main() {
  int max, num = 0;
  int element[10000];
  int prime[10000];
  int numOfPrime = 1;
  cin >> num;
  for (int i = 0; i < num; i++) {
    cin >> element[i];
    if (max <= element[i]) {
      max = element[i];
    }
  }
  numOfPrime = getPrimeNumbers(max, prime);
  int primeCounter = 0;
  for (int i = 0; i < num; i++) {
    for (int j = 0; j < numOfPrime; j++) {
      if (prime[j] == element[i]) {
        primeCounter++;
        break;
      }
      if (element[i] % prime[j] == 0) {
        break;
      } else if (element[i] < prime[j] * prime[j]) {
        primeCounter++;
        break;
      }
    }
  }
  cout << primeCounter << endl;
  return 0;
}
