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