#include <bits/stdc++.h>
using namespace std;
bool a[100000000];
int main() {
  int n, m, count = 0;
  a[2] = a[3] = 1;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m;
    if (m > 3) {
      for (int k = 3; k <= m; k += 2) {
        int f = 0;
        for (int j = 3; j <= sqrt(k); j += 2)
          if (k % j == 0) {
            f = 1;
            break;
          }
        if (f == 0) a[k] = 1;
      }
    }
    if (a[m] == 1) count++;
  }
  cout << count << endl;
  return 0;
}
