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