#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, m, num = 0;
  double d;
  cin >> N;
  int j;
  for (int i = 0; i < N; i++) {
    cin >> m;
    d = sqrt(m);
    for (j = 2; j <= (int)d && m % j; j++)
      ;
    if ((int)d == j) {
      num++;
    }
  }
  cout << num << endl;
}
