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