#include <bits/stdc++.h>
int main(void) {
  int n, COUNT = 0;
  std::cin >> n;
  for (int i = 0; i < n; ++i) {
    int x;
    std::cin >> x;
    bool FLUG = false;
    for (int i = x - 1; i > 1; --i) {
      if (x % i == 0) {
        FLUG = true;
      }
    }
    if (FLUG == false) {
      ++COUNT;
    }
  }
  std::cout << COUNT << std::endl;
  return 0;
}
