#include <bits/stdc++.h>
using namespace std;
bool isPrime(int x) {
  if (x < 2)
    return false;
  else if (x == 2)
    return true;
  if (x % 2 == 0) return false;
  int limit = (int)sqrt((double)x) + 1;
  for (int i = 3; i <= x; i += 2) {
    if (x % i == 0) return false;
  }
  return true;
}
int main() {
  int n, x;
  int cnt = 0;
  cin >> n;
  assert(1 <= n && n <= 10000);
  for (int i = 0; i < n; i++) {
    cin >> x;
    assert(2 <= x && x <= 1000000000);
    if (isPrime(x)) cnt++;
  }
  cout << cnt << endl;
}
