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