#include <bits/stdc++.h>
bool isPrime(long long a);
int main() {
  using namespace std;
  long long A[10001];
  int n, prime = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    if (isPrime(A[i])) {
      prime++;
    }
  }
  cout << prime << endl;
  return 0;
}
bool isPrime(long long a) {
  for (long long i = 2; i < a; i++) {
    if (a % i == 0) {
      return false;
    }
  }
  return true;
}
