#include <bits/stdc++.h>
using namespace std;
int n, maxn = 0, ans = 0;
int a[10001];
bool IsPrime[10001 * 1000];
bool Isprime(int x) {
  bool flag = true;
  if (IsPrime[x] == true) {
    for (int i = 2; i <= sqrt((double)x); i++)
      if (x % i == 0) {
        flag = false;
        break;
      }
    if (flag == true) {
      int cot = 2;
      while (cot * x <= maxn) {
        IsPrime[cot * x] = false;
        cot++;
      }
    }
    return flag;
  } else
    return false;
}
int main() {
  memset(IsPrime, true, sizeof(IsPrime));
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    maxn = max(maxn, a[i]);
  }
  for (int i = 1; i <= n; i++)
    if (Isprime(a[i])) ans++;
  printf("%d\n", ans);
  return 0;
}
