#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n, c, count = 0, number[10000];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> number[i];
    c = 0;
    for (j = 1; j <= number[i]; j++) {
      if (number[i] % j == 0) {
        c++;
      }
      if (c == 2 && number[i] == j) {
        count++;
      }
    }
  }
  cout << count << endl;
  return 0;
}
