#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n) {
  int sq = sqrt((double)n);
  if (n == 1) return false;
  if (n == 2) return true;
  for (int i = 2; i <= sq; ++i)
    if (n % i == 0) return false;
  return true;
}
int main() {
  int N, z, c, i;
  for (cin >> N; c = 0, cin >> z, --N; isPrime(z) ? ++c : 0)
    ;
  cout << c << endl;
}
