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