#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, c = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == 2) c++;
    if (a < 2 || a % 2 == 0) continue;
    for (int x = 3; x <= sqrt(a); a++) {
      if (a % x == 0) {
        c--;
        break;
      }
    }
    c++;
  }
  cout << c << endl;
  return 0;
}
