#include <bits/stdc++.h>
using namespace std;
const int N = 100000000 + 1;
bitset<N> arr;
void eratosthenes() {
  for (int i = 2; i < N; ++i) {
    arr[i] = 1;
  }
  for (int i = 2; i < sqrt(N); ++i) {
    if (arr[i]) {
      int k;
      for (int j = 2; k < N; j++) {
        k = i * j;
        arr[k] = 0;
      }
    }
  }
}
bool is_prime(int n) { return arr[n]; }
int main() {
  eratosthenes();
  int n;
  cin >> n;
  int count;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (is_prime(x)) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
