#include <bits/stdc++.h>
const int SIZE = 10000005;
using namespace std;
int book[SIZE];
void initBook() {
  for (int i = 0; i < SIZE; i++) {
    book[i] = 0;
  }
  for (int i = 2; i < SIZE; i++) {
    int flag = 1;
    for (int j = 2; j <= sqrt(i); j++) {
      if (i % j == 0) {
        flag = 0;
      }
    }
    if (flag) {
      book[i] = 1;
    }
  }
}
int main() {
  initBook();
  int n, a;
  int count = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (book[a]) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
