#include <bits/stdc++.h>
using namespace std;
const int N = 100000002;
int prime[N];
int main(void) {
  int n;
  int ans = 0;
  cin >> n;
  for (int i = 0; i < N; i++) {
    prime[i] = 1;
  }
  prime[0] = prime[1] = 0;
  for (int i = 2; i < N; i++) {
    if (prime[i] == 1) {
      for (int j = 2; i * j < N; j++) {
        prime[i * j] = 0;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (prime[x] == 1) {
      ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
