#include <bits/stdc++.h>
using namespace std;
int num[11111111] = {0};
int n;
int m;
int main() {
  num[1] = 1;
  for (int i = 2; i < 10000001; i++) {
    if (num[i] == 0) {
      for (int j = 2; j * i <= 10000001; j++) {
        num[j * i] = 1;
      }
    }
  }
  int t = 0;
  scanf(" %d", &n);
  for (int i = 0; i < n; i++) {
    scanf(" %d", &m);
    if (num[m] == 0) t++;
  }
  cout << t << endl;
  return 0;
}
