#include <bits/stdc++.h>
using namespace std;
const int maxn = 50001;
int prime[maxn], cnt, res;
bool isprime[maxn];
void maketable() {
  int base = (int)sqrt((double)maxn);
  isprime[0] = isprime[1] = 1;
  for (int i = 2; i < base; i++) {
    if (!isprime[i]) {
      prime[cnt++] = i;
      for (int j = i + i; j < maxn; j += i) {
        isprime[j] = 1;
      }
    }
  }
}
void solve(int n) {
  int k = (int)sqrt((double)n);
  for (int i = 0; prime[i] <= k; i++) {
    if (n % prime[i] == 0) {
      return;
    }
  }
  res++;
}
int main() {
  maketable();
  int n, s;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &s);
    solve(s);
  }
  printf("%d\n", res);
  return 0;
}
