#include <bits/stdc++.h>
using namespace std;
bool IsPrime(int num) {
  if (num < 2)
    return false;
  else if (num == 2)
    return true;
  else if (num % 2 == 0)
    return false;
  double sqrtNum = sqrt(num);
  for (int i = 3; i <= sqrtNum; i += 2) {
    if (num % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  int* in = new int[n];
  int count = 0;
  for (int i = 0; i < n; i++) {
    cin >> in[i];
    if (IsPrime(in[i])) count++;
  }
  cout << count;
}
