#include <bits/stdc++.h>
using namespace std;
long long a[100000000];
inline int sushu(int n) {
  for (int i = 2; i < n; i++)
    if (n % i == 0) return 0;
  return 1;
}
int main() {
  int n;
  while (cin >> n) {
    int s = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (sushu(a[i]))
        s++;
      else
        continue;
    }
    cout << s << endl;
  }
}
