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