#include <bits/stdc++.h>
using namespace std;
bool NUM[100000000 + 1] = {};
int main() {
  for (int i = 0; i < (100000000 + 1); i++) NUM[i] = true;
  NUM[0] = false;
  NUM[1] = false;
  for (int i = 2; i * i <= 100000000 + 1; i++) {
    if (NUM[i] == false)
      continue;
    else {
      for (int j = i * 2; j < 100000000 + 1; j += i) {
        NUM[j] = false;
      }
    }
  }
  int n, ans = 0;
  cin >> n;
  for (int i = 0; i < (n); i++) {
    int temp;
    cin >> temp;
    if (NUM[temp] == true) ans++;
  }
  cout << ans << endl;
  return 0;
}
