#include <bits/stdc++.h>
using namespace std;
bool primep(int num) {
  if (num % 2 == 0) return false;
  for (int i = 3; i < (int)sqrt(num); i += 2)
    if (num % i == 0) return false;
  return true;
}
int main() {
  int n;
  int count = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (primep(a)) count++;
  }
  cout << count << endl;
  return 0;
}
