#include <bits/stdc++.h>
using namespace std;
int isPrime(int number) {
  for (int i = 2; i * i <= number + 10; i++) {
    if (number % i == 0) return 0;
  }
  return 1;
}
int main() {
  int n;
  cin >> n;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    sum += isPrime(x);
  }
  cout << sum << endl;
  return 0;
}
