#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt = 0;
  cin >> n;
  while (n--) {
  A:
    int c;
    cin >> c;
    double Sq = sqrt(c);
    for (int i = 2; i <= Sq; i++) {
      if (c % i == 0) {
        n--;
        goto A;
      }
    }
    cnt++;
  }
  cout << cnt << endl;
  return 0;
}
