#include <iostream>
#include <algorithm>
 
using namespace std;
 
bool setPrime ( int size, bool isPrime[] )
{
  isPrime[0] = isPrime[1] = false;

  for (int i = 2; i < size; ++i)
  {
    isPrime[i] = true;
  }

  for (int i = 2; (i*i) < size; ++i)
  {
    if (!isPrime[i]) { continue; }

    for (int j = i+i; j < size; j += i)
    {
      isPrime[j] = false;
    }
  }
}

int main ( void )
{
  const int size = 100000001;
  int n, count = 0;
  int *isPrime = new int[size];

  setPrime(size, isPrime);

  cin >> n;
 
  for (int i = 0; i < n; ++i)
  {
    int p;
 
    cin >> p;
 
    if (isPrime[p]) { ++count; }
  }
 
  cout << count << endl;

  delete [] size;
 
  return 0;
}