#include <bits/stdc++.h>
bool isprime[100000000];
int main(void) {
  for (int i = 0; i < 100000000; ++i) {
    isprime[i] = true;
  }
  isprime[0] = isprime[1] = false;
  for (int i = 2; i < 10000; ++i) {
    if (isprime[i]) {
      for (int j = i + i; j < 100000000; j += i) {
        isprime[j] = false;
      }
    }
  }
  int N;
  int A;
  int ans = 0;
  std::cin >> N;
  for (int i = 0; i < N; ++i) {
    std::cin >> A;
    if (isprime[A]) {
      ans += 1;
    }
  }
  std::cout << ans << std::endl;
  return 0;
}
