#include <bits/stdc++.h>
using namespace std;
vector<bool> p(100000100, true);
void makep() {
  for (int i = 0; i < 100000100; i++) {
    if (i < 2) p[i] = false;
    for (int j = 2; j <= sqrt(i); j++) {
      if (i % j == 0) {
        p[i] = false;
        break;
      }
    }
  }
}
int main() {
  makep();
  int n;
  int cnt = 0;
  int a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (p[a] == 1) cnt++;
  }
  cout << cnt << endl;
}
