#include <bits/stdc++.h>
bool isPrime(unsigned int elem) {
  if (elem <= 3) return true;
  if (elem % 2 == 0) return false;
  unsigned int max = elem / 2;
  for (unsigned int i = 2; i < max; i++) {
    if (elem % i == 0) return false;
  }
  return true;
}
int main() {
  unsigned int N, elem;
  unsigned int ans = 0;
  std::cin >> N;
  for (unsigned int i = 0; i < N; i++) {
    std::cin >> elem;
    if (isPrime(elem)) ans++;
  }
  std::cout << ans << std::endl;
}
