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