#include <bits/stdc++.h>
using namespace std;
bitset<10000000> isprime;
vector<int> prime;
void sieve() {
  isprime[1] = 1;
  for (int i = 4; i < 10000000; i += 2) isprime[i] = 1;
  for (int i = 3; i * i <= 10000000; i += 2) {
    if (isprime[i] == 0) {
      for (int j = i * i; j < 10000000; j += i) isprime[j] = 1;
    }
  }
  for (int i = 1; i < 10000000; i++) {
    if (isprime[i] == 0) prime.push_back(i);
  }
}
bool again(int b) {
  for (int i = 0; prime[i] * prime[i] < b; i++) {
    if (b % prime[i] == 0) {
      return true;
    }
  }
  return true;
}
int main() {
  sieve();
  long long n;
  int t, k = 0;
  scanf("%d", &t);
  while (t--) {
    scanf("%lld", &n);
    if (n > 10000000) {
      if (again(n) == 0) k++;
    } else if (isprime[n] == 0)
      k++;
  }
  printf("%d\n", k);
  return 0;
}
