#include <bits/stdc++.h>
using namespace std;
int prime[100000001];
void isPrime() {
  for (int i = 0; i < 100000000; ++i) {
    prime[i] = 1;
  }
  prime[0] = prime[1] = 0;
  for (int i = 2; i < 100000000 / 2; ++i) {
    if (prime[i] == 1) {
      for (int j = i + i; j < 100000000; j += i) prime[j] = 0;
    }
  }
}
int main() {
  int n;
  cin >> n;
  isPrime();
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    sum += prime[t];
  }
  cout << sum << endl;
}
