#include <bits/stdc++.h>
using namespace std;
int IsPrime(int p) {
  int i, x;
  if (x < 2) return 0;
  if (x == 2) return 1;
  if (x % 2 == 0) return 0;
  for (i = 3; i * i <= x; i += 2) {
    if (x % i == 0) return 0;
    return 1;
  }
}
int main(void) {
  int count = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int p;
    cin >> p;
    if (IsPrime(p)) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
