#include <bits/stdc++.h>
bool *isPrime = new bool[100000001];
void init() {
  for (int i = 2; i < 100000001; i++) isPrime[i] = true;
  for (int i = 2; i * i < 100000001; i++) {
    if (isPrime[i]) {
      for (int j = i * 2; j < 100000001; j += i) isPrime[j] = false;
    }
  }
}
int main() {
  init();
  int n, cnt = 0;
  std::cin >> n;
  for (int i = 0, a; i < n; i++) {
    std::cin >> a;
    if (isPrime[a]) cnt++;
  }
  std::cout << cnt << std::endl;
  delete[] isPrime;
  return 0;
}
