#include <bits/stdc++.h>
using namespace std;
bool sosu(int n) {
  if (n < 2)
    return false;
  else if (n == 2)
    return true;
  else if (n % 2 == 0)
    return false;
  int root = sqrt(n);
  for (int i = 3; i < root; i += 2) {
    if (n % i == 0) return false;
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (sosu(x) == true) sum++;
  }
  cout << sum << endl;
}
