#include <bits/stdc++.h>
using namespace std;
int Myprime(int x) {
  for (int i = 2; i <= x / 2; i++)
    if (!(x % i)) return 0;
  return 1;
}
int main() {
  int n, count = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    count += Myprime(x);
  }
  cout << count << "\n";
  return 0;
}
