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