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