#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<char> bo(100000001);
  int n, a;
  bo[0] = true;
  bo[1] = true;
  for (int i = 2; i < 100000001; ++i) {
    if (bo[i] == false) {
      for (int j = i + i; j < 100000001; j += i) {
        bo[j] = true;
      }
    }
  }
  cin >> n;
  int count = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    if (bo[a] == false) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
