#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, an;
  cin >> n;
  an = n;
  while (n--) {
    cin >> a;
    for (int i = 2; i * i <= a; i++)
      if (a % i == 0) an--;
  }
  cout << an << endl;
  return 0;
}
