#include <bits/stdc++.h>
using namespace std;
bool prime[100000000] = {false};
void build_table(bool *arr);
void check(bool *arr);
int main() {
  build_table(prime);
  int n;
  cin >> n;
  int cnt = 0;
  int in;
  for (int i = 0; i < n; i++) {
    cin >> in;
    if (prime[in] == true) cnt++;
  }
  cout << cnt << endl;
}
void build_table(bool *prime) {
  prime[0] = prime[1] = false;
  prime[2] = true;
  for (int i = 3; i < sqrt(100000000); i += 2) {
    bool flag = true;
    for (int j = 3; j < i; j += 2) {
      if (i % j == 0) flag = false;
    }
    if (flag == true) prime[i] = true;
  }
}
void check(bool *prime) {
  for (int i = 0; i < 100000000; i++)
    if (prime[i] == true) cout << i << endl;
}
