#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long n) {
  if (n < 2) return false;
  for (long long i = 2; i * i <= n; i += 2)
    if (n % i == 0) return false;
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int r = 0;
  for (int i = 0; i < (int)(n); i++) {
    int x;
    cin >> x;
    r += isPrime(x);
  }
  cout << r << endl;
  return 0;
}
